...

View Full Version : PHP Image Uploading



Spudster
07-17-2012, 01:57 AM
I am working on a project and am currently doing the learning aspects of coding.

Anyway im trying to allow users to upload/share there own photos how can i allow users to upload photos to the server from there computer or a external link/ such as eg: google.com/images/image.png or jpg etc..

Thanks,

Spudster

PS: Im using
PHP Session Login
SQL Database

DrDOS
07-17-2012, 02:22 AM
You can start the way I did, the way I nearly always do. Look up 'image upload example' on Google, download some of the example scripts, practice with them. Then, after you know a a bit more, come back and ask any more questions you need answered.

Spudster
07-17-2012, 02:34 AM
Thanks for the quick answer :)

Im hoping i can use the database todo this, some people on google say that it needs to be done by directoies...

DrDOS
07-17-2012, 03:11 AM
Thanks for the quick answer :)

Im hoping i can use the database todo this, some people on google say that it needs to be done by directoies...Yes, you need directories, you can either make temporary directories, have people make a directory with their username, or choice of name, and you can make sub-directories with their choice of names. The database will make it easier and better. The best way is to keep all the users directories in a 'big' directory that only has users directories in it, nothing else. That 'sandboxes' them from the rest of the files. Keep all the data in the database, although you can put some user files in their own directories. All very 'do-able' with php, just needs to be coded. Hve fun.

Spudster
07-17-2012, 03:18 AM
Ok Thanks, so how does facebook keep all there images in one folder how complex...

So if i keep all photos in a directory how do i make a delete/create direcotry with php? and make it echo it on a page & create the paths in the database?

This seems to be complicated..

DrDOS
07-17-2012, 04:03 AM
Ok Thanks, so how does facebook keep all there images in one folder how complex...

So if i keep all photos in a directory how do i make a delete/create direcotry with php? and make it echo it on a page & create the paths in the database?

This seems to be complicated..Facebook uses the database. The image files are all given new names, which are just sequential numbers, by using a queing function which just increments each time a new image needs to be named. No two numbered alike. The original name is kept alongside the new name in the database. There needs to be two databases, one for the users info, including a list of their photos by new name, and one for the new names and the old names. More info can be included in either one, but that is an absolute minimum. So you have to decide which one is more complicated, theirs or mine.

Spudster
07-17-2012, 04:56 AM
There one seems more simpler.

All I need todo is work out how to get an image to upload in the database and echo successfully.. I guess I can look this up on google.

I use tables to gather the info If I can get everything to be a one place it would make it a lot easier.

Thanks for your help im slowly starting to understand the aspect of this :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum