|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||||
|
|||||
|
File Upload Problem
Hey folks, i'm having some problems with this upload script of mine. I get a fair few errors, just wondering if anyone can spot the flaws...
Heres my script: php Code:
cheers in advance... |
|
#2
|
|||
|
|||
|
RE: File Upload Problem
Give us a couple of your errors? just about the top 10 should be enough..
|
|
#3
|
|||
|
|||
|
RE: File Upload Problem
I'm with CmdrDats on this one..let's see some of those errors...but, for starters:
$UPLOAD_TYPES['JPG'] == 1; //Allow .jpg $UPLOAD_TYPES['JPEG'] == 1; $UPLOAD_SIZES['max'] == 100000; $UPLOAD_SIZES['min'] == 0; on all those you are doing comparisions. Don't you want to do assignments? I.e. one equal sign... |
|
#4
|
|||||
|
|||||
|
RE: File Upload Problem
yes matt, i certainly did want to do assignments
here are some errors i'm getting: Parse error: parse error, expecting `','' or `';'' in /home/sites/site93/web/testing_arena/upload2.php on line 19 which is this line: then theres these php Code:
if i fix these ones i should be able to sort it out hopefully.. |
|
#5
|
|||
|
|||
|
RE: File Upload Problem
This:
echo 'File: ' . $HTTP_POST_FILES['upload_file']['name'] . '<br>' 'Size: ' . $HTTP_POST_FILES['upload_file']['size'] . '<br><br>'; should be: (note the added period): echo 'File: ' . $HTTP_POST_FILES['upload_file']['name'] . '<br>' . 'Size: ' . $HTTP_POST_FILES['upload_file']['size'] . '<br><br>'; try changing: $MY_FILE = $HTTP_POST_FILES['upload_file']; to: $MY_FILE = $HTTP_POST_FILES['upload_file']['tmp_name']; |
|
#6
|
|||
|
|||
|
RE: File Upload Problem
Thanks, that fixed most problems, although now it keeps saying it is too large when it is under the limit
|
|
#7
|
|||
|
|||
|
RE: File Upload Problem
I'd be interested to know what size file you are trying with..remember 100000 bytes equates to 97.65 kilobytes....
|
|
#8
|
|||
|
|||
|
RE: File Upload Problem
the file i'm trying with is a 13.6kb .jpg file. I also tried to upload a .txt file and i got the error: file too large
|
|
#9
|
|||
|
|||
|
RE: File Upload Problem
hmmm...ok, i just realised that it does actually insert it into the database, yet i still get the error message
|