kool_samule Posted March 5, 2010 Share Posted March 5, 2010 Hi Chaps, I've got access to my FTP site through my PHP App, can create a directory, and read the contents of the directory. I'm now trying to upload files to a directory: // Upload // Local File $local_file = 'C:/01.pdf'; // Remote File $remote_file = $workingDir.$dir.'01.pdf'; // Upload File to Active Directory $upload = ftp_put($conn, $remote_file, $local_file, FTP_ASCII); // Check Upload Status: print (!$upload) ? 'Cannot upload' : 'Upload complete'; print "\n"; Locally, 01.pdf is 2630Kb but the upload takes for ever and never reaches the same file size on the FTP site. I've tried it with word docs (24Kb), the upload takes no time at all, but appears as 1Kb on the FTP site and is obviously corrupt and fails to open. How can I make sure that the file is copied correctly to the site? Cheers Link to comment https://forums.phpfreaks.com/topic/194232-php-ftp-upload-problem/ Share on other sites More sharing options...
Wolphie Posted March 5, 2010 Share Posted March 5, 2010 Change the mode to FTP_BINARY and try again. Link to comment https://forums.phpfreaks.com/topic/194232-php-ftp-upload-problem/#findComment-1021869 Share on other sites More sharing options...
kool_samule Posted March 5, 2010 Author Share Posted March 5, 2010 Booooom! Awesome, works like a charm. . . .Cheers Dude! Link to comment https://forums.phpfreaks.com/topic/194232-php-ftp-upload-problem/#findComment-1021874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.