Ticket #429 (closed Bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

Upload.php issues after 2.4 update: wrong path, folder does not exist, file not uploading.

Reported by: kevinkilcher Owned by: fredck
Priority: Normal Milestone:
Component: Server : PHP Version: FCKeditor 2.4
Keywords: Cc:

Description

After upgrading to fckeditor 2.4, I started having issues with uploading files using upload.php.

PROBLEM: Upload.php uploads files to Images, Files, Media and Flash while the browser uploads files to images, files, media and flash. Upload.php also assumes that the folder exists and if it does not then fck will return saying the file was uploaded successfully but the file will not be there.

SOLUTION: In the file fckeditor/editor/filemanager/upload/php/upload.php make the following changes. (My file's line numbers seem to be different than those in some of the documentation I have read, so I will include both the line number as well as the line to insert the code before or after):

At line 71 INSERT the following code:

// Convert $sType to lowercase to conform with changes made as of fck 2.4 $sType = strtolower($sType);

AFTER SendResults( 1, , , 'Invalid type specified' ) ;

This allows fck to validate the upload file type several lines earlier then changes the value of $sType for the remainder of the file.

At line 112 insert the following code:

// Creates the directory if it does not exist yet. if(!is_dir($sServerDir)){

mkdir($sServerDir);

}

AFTER the else statement and BEFORE if ( is_file( $sFilePath ) )

This will allow fck to create the upload file if it does not exist.

This ticket is related to ticket #274, #275 and #416.

Change History

Changed 3 years ago by alfonsoml

  • keywords upload.php removed
  • status changed from new to closed
  • resolution set to duplicate

The first part is #274, and the mkdir issue is #416 Closing as dup

Note: See TracTickets for help on using tickets.