image upload?

Discussion in 'HTML & Website Design' started by olddocks, Nov 11, 2007.

  1. #1
    which is best method to upload and store an image? in a webserver or in a mysql database?

    actually i am coding a script that could allow users to upload their profile picture.

    how to do it in a safe way without any security risk and maximising the performance?
     
    olddocks, Nov 11, 2007 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    i can do this for $25 by paypal

    Regards

    Alex
     
    kmap, Nov 11, 2007 IP
  3. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #3
    On my site at www.unitedlocalbands.com I allow user to save the url link of their picture from photobucket to my database. Then I use my server script (in my case its coldfusion) and an sql statment to return that link to an image tag. This way I dont have to allow them to upload any files to my server. Photobucket has a great tool the you can add to your site so that the user doesnt have to even leave your site to log into photobucket. You just have to add an iframe to your site.

    i.e.
    <img src="<cfoutput>#user.pictureurl#</cfoutput>"/>
    Code (markup):
    the img tag above looks like this to the web browser after coldfusion inserts the url,

    <img src="http://www.picture.jpg"/>
    Code (markup):
    Are you using a server side script?
     
    unitedlocalbands, Nov 12, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The old db -v- file system question.... generally it is more effecient to stick it on the webserver rather than the SQL server if you are hosting the files yourself rather than unitedlocalbands suggestion of only pointing to the image rather than uploading it.
     
    AstarothSolutions, Nov 12, 2007 IP
  5. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #5
    yes, i am using the server script in PHP
     
    olddocks, Nov 12, 2007 IP