|
Posted by Dean Richardson on 11/18/57 11:43
Hi,
I'm having trouble uploading files via a PHP script. Whenever I upload
a file greater than 10K, the file gets corrupted. However, text files
upload OK.
When I check the FTP Server log I find this:
(000001) 24/03/2006 09:17:32 - dean (127.0.0.1) > logged in.
(000001) 24/03/2006 09:17:32 - dean (127.0.0.1) > 230 User dean logged
in.
(000001) 24/03/2006 09:17:32 - dean (127.0.0.1) > TYPE I
(000001) 24/03/2006 09:17:32 - dean (127.0.0.1) > 200 Type set to I.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > SIZE
/system/uploads/c1d58880229e579b1a05a4c1aee35e71Doc1.doc
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > 550 No such file or
directory.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > EPSV
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > 500 Unknown command.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > PASV
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > 227 Entering Passive
Mode (127,0,0,1,33,225)
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > STOR
/system/uploads/c1d58880229e579b1a05a4c1aee35e71Doc1.doc
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > asked to upload
'\system\uploads\c1d58880229e579b1a05a4c1aee35e71Doc1.doc' in
'C:\Server\Apache Group\Apache2\htdocs\' --> Access allowed.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > 150 Data connection
accepted from 127.0.0.1:4479; transfer starting for
c1d58880229e579b1a05a4c1aee35e71Doc1.doc.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > started uploading
'\system\uploads\c1d58880229e579b1a05a4c1aee35e71Doc1.doc' in
'C:\Server\Apache Group\Apache2\htdocs\'.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > QUIT
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > 221 Bye bye ...
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > aborted uploading
'\system\uploads\c1d58880229e579b1a05a4c1aee35e71Doc1.doc' in
'C:\Server\Apache Group\Apache2\htdocs\' - (00:00:01 - 7.031 KB -
7.031 KBytes/s).
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > file partially
uploaded : 'C:\Server\Apache
Group\Apache2\htdocs\system\uploads\c1d58880229e579b1a05a4c1aee35e71Doc1.doc'
deleted.
(000001) 24/03/2006 09:17:33 - dean (127.0.0.1) > disconnected.
(00:00:00)
For some reason, I can run my PHP script on a third party server and it
works OK, so something tells me that I am missing something.
The php script is below:
$uploaddir = init_upload_imports();
//copy the file to some permanent location
if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $uploaddir .
$custno.$_FILES["userfile"]["name"]))
{
$v_attachments=$custno.$_FILES["userfile"]["name"];
}
else
{
echo ("error!");
}
Any help would be very much appreciated.
Thanks in Advance.
Dean
[Back to original message]
|