Last modified: 2012-04-12 13:55:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29919, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27919 - Upload fails: could not remove file from /tmp to /images/**/*/
Upload fails: could not remove file from /tmp to /images/**/*/
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.16.x
All Linux
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-07 17:25 UTC by werf75
Modified: 2012-04-12 13:55 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description werf75 2011-03-07 17:25:44 UTC
Upload fails everytime, with a very clean install also.The error message is like "could not rename file from /tmp/filename.ext to /images/**/*/filename.ext

A working solution is to execute what's written hereunder:


Edit: 
../includes/filepro/FSRepo.php -> line 428
 
Change:
if (!rename( $srcPath, $dstPath ) ) {
    $status->error( 'filerenameerror', $srcPath, $dstPath );
    $good = false;
}
 
In:
 
if ( !move_uploaded_file( $srcPath, $dstPath ) ) {
    $status->error( 'filerenameerror', $srcPath, $dstPath );
    $good = false;
}
Comment 1 Bryan Tong Minh 2011-03-07 17:30:50 UTC
This presumably is because of safemode related restrictions. Changing rename to move_uploaded_file will break other upload stuff. An option would be to not pass File::DELETE_SOURCE in UploadBase::performUpload and do the cleanup ourselves in Upload::unsaveTempFile.
Comment 2 werf75 2011-03-28 19:52:45 UTC
Problem solved. This issue had to do with the wiki not installed in the /wiki folder and with a VCL (?) that needed exceptions. Now everything is working, with the code above reverted to original.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links