Hi i am wondering could anyone help me understand a file upload code. I am currently working on a website like mediafire, raipidshare and the rest of them. I have taken down codes of all sorts and some i got to work but had errors. I don't understand as i take them down perfect and they still don't work. And as i am making a File Uploading site i need to understand them more. I am newish to coding but am a good quick learner and can do everything but use MySQL or connect to a DB. Any help is useful and a code would be nice too :)
Regards,
-Dyla.
dyla123
0
Newbie Poster
Recommended Answers
Jump to PostWant to post the code you're using and let us know what the error seems to be?
Jump to PostIs it on a server that is correctly configured to serve PHP files?
Jump to PostCheck that your directory references are correct. Is upload directory in the same directory as Upload_file.php? If not, that may be your problem. Also, ensure that the directory is writable.
Jump to PostIt suggests something missing like a ; or an extra }
Try this
<?php if(($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/pjpeg") && $_FILES["file"]["size"] < 20000) { if($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { …
All 15 Replies
diafol
dyla123
0
Newbie Poster
burgercho
16
Light Poster
dyla123
0
Newbie Poster
diafol
dyla123
0
Newbie Poster
dyla123
0
Newbie Poster
diafol
dyla123
0
Newbie Poster
diafol
dyla123
commented:
Code seem better now :)
+1
dyla123
0
Newbie Poster
diafol
dyla123
0
Newbie Poster
dyla123
0
Newbie Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.