Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts

    PHP Image Uploading

    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

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,030
    Thanks
    15
    Thanked 240 Times in 240 Posts
    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.

  • Users who have thanked DrDOS for this post:

    Spudster (07-17-2012)

  • #3
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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...

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,030
    Thanks
    15
    Thanked 240 Times in 240 Posts
    Quote Originally Posted by Spudster View Post
    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.

  • Users who have thanked DrDOS for this post:

    Spudster (07-17-2012)

  • #5
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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..
    Last edited by Spudster; 07-17-2012 at 03:32 AM.

  • #6
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,030
    Thanks
    15
    Thanked 240 Times in 240 Posts
    Quote Originally Posted by Spudster View Post
    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.

  • #7
    New Coder
    Join Date
    Jul 2012
    Posts
    70
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •