Mac Os 10.1.5, PHP 4.1.2, Apache1.2.22
Even with the simpliest code, (in fact copy/pasting example from PHP Manual !) uploading locally, I get files corrupted.
I upload a Word file then I´ll can´t open with Word the uploaded file.
I tried with move_uploade_file() and copy() also.
I treid also with strictly unix files - made with BBedit or with Mac Os TextEdit (guessin it was a matter of resourse/fork Mac issue) -; same problem.
Does anybody know what´s going on?
Thanks in advance.
Edwin.
Files get corrupted in uploads
Moderator: General Moderators
-
emac
- Forum Newbie
- Posts: 3
- Joined: Mon Jun 16, 2003 6:55 pm
- Location: Buenos Aires, Argentina.
- Contact:
First I write a code full of validation and didn´t work.
Then use the simplies one borrow from the manual:
As you see coudn´t be a problem in the code as it´s so simply.
I think the problem is in the configuration of my server, I´m afraid.
Could be a configuration in php.ini? Don´t think so. In the Apache: may be.
Now I, m trying to test that simple code in a Linux server just to confirm muy suposition.
Thanks.
PD: Excuse my english.
Then use the simplies one borrow from the manual:
Code: Select all
<?php
$uploaddir = '/Users/edwin/Sites/Congreso03/resumenes/';
// >>>>field name used in form is "resumen"<<<
print "<pre>";
if (move_uploaded_file($_FILESї'resumen']ї'tmp_name'], $uploaddir . $_FILESї'resumen']ї'name'])) {
//if (copy($_FILESї'resumen']ї'tmp_name'], $uploaddir .
$_FILESї'resumen']ї'name'])) { <<< I tried this way to cause read in a forum
print "File is valid, and was successfully uploaded. Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
?>I think the problem is in the configuration of my server, I´m afraid.
Could be a configuration in php.ini? Don´t think so. In the Apache: may be.
Now I, m trying to test that simple code in a Linux server just to confirm muy suposition.
Thanks.
PD: Excuse my english.
-
emac
- Forum Newbie
- Posts: 3
- Joined: Mon Jun 16, 2003 6:55 pm
- Location: Buenos Aires, Argentina.
- Contact:
Quite Odd!!!
I was tried early with a TextEdit file and with a pdf one: both get corrupted.
When you suggest wit Simple Text I tried with a php log file and it wasn´t corrupted!!
Then I did with a pdf again and now it works fine ?¿?¿?
So I get the originaly file to upload, a Word template: corrupt. (Congreso2003.doc)
Resave and Try: corrupt.
Save with another name (Congreso.doc): Not corruted!!!!!
Edwin
I was tried early with a TextEdit file and with a pdf one: both get corrupted.
When you suggest wit Simple Text I tried with a php log file and it wasn´t corrupted!!
Then I did with a pdf again and now it works fine ?¿?¿?
So I get the originaly file to upload, a Word template: corrupt. (Congreso2003.doc)
Resave and Try: corrupt.
Save with another name (Congreso.doc): Not corruted!!!!!
Edwin