Left Quote    Knowledge speaks, but wisdom listens.
- Jimi Hendrix    
Right Quote
[login] | [Register]

Uploading Image Files with PHP

by: bs0d
Page: 5 of 5
(View All)

Conclusion and Debugging

No more code is required to upload a file from this point in the script. Any other coding is up to you for the other parts of your script or website. The first time I began constructing an image upload script, I found it quite useful to display the variables along the way for debugging. Particularly, displaying the array of information about image stored in the $_FILES array. You could use var_dump() to display everything, but its not visually friendly. Instead, here is the same information but broken up a bit to make it easier to read:

Here is all of the code for the script.

Displaying the value of other variables as you progress through your script will also aid in any complications you encounter. As always, feel free to post any questions about the script or any other subject for that manner in the Forums for help. Thanks for reading, I hope you found value in the article and it will help you get set in the right direction.

-bs0d |

1  |  2  |  3  |  4  |  5  |  


  Subject: "Fixed Error, $end" Date: Dec 29 2007 at 10:06 pm    

Part -- Accessing the File

Current Code-

$info = getimagesize($_ FILES['userfil e']['tmp_name ']);

Should Be-

$info = getimagesize($_ FILES['userfil e']['tmp_name ']);

  Subject: "multiple image uploads?" Date: Apr 23 2008 at 3:31 pm    

VERY GOOD TUTORIAL!!! nice and easy to follow!

one question i do have though, is how would you upgrade this to deal with multiple image uploads in one form?

That is what i am trying to do for my website at the moment, do you simply put the extra image upload fields within the form?

but how would you validate these images?


You Must be logged in or a member to comment.

Tutorial Stats

Tutorial Stats

8 Total Comments
5 Rating of 5 (1 Votes)


Tutorial Options

· Login to Rate This Article
· Login to Post a Comment
· Read more by this author
Digg This Article! Bookmark This Article Reddit: Bookmark This Article BlinkList: Blink This Article! YahooMyWeb BlogMarks: Add This Mark! Furl: Save This Article Spurl: Mark This Article



· Simple PHP Tutorial
· One File Website
· Pagination with PHP
· Building a Comments Script
· Complete Members System
· Variable Scope

"" Copyright © 2002-2020; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank