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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Uploading an image.

    Hello everyone. I'm looking for a script that will not only upload an image (jpeg or gif) to my webspace but also save it's information into my MYSQL database. The information I want the DB to save is the images *new* file name, the user who uploaded the image, and the title (which I want the user to be allowed to name) for diplaying purposes.

    I've been reading around and many people suggest not using the BLOB method. But then again I read that a lot people would suggest the BLOB method. Basically what I'm going for is an easy script that my registered users can access to upload images onto their own personal profile.

    Any scriplets, links, or any leads of any kind would be greatly appreciated!

    Joey-Out.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Assuming small images, I'd go with a standard mediumtext field with base64 encoding. But if its larger images, perhaps blob would be your best bet.
    Personally, I use blob, but I tend to use larger images as well.
    This is a simple task.

    Now, controlling images on your filesystem may be the tougher aspect. It depends on what you allow, how large, how many, how many users, etc.
    First thing to remember is that you don't want to overwrite an already existing image, unless thats the purpose of it. Second thing is security. Never allow users to upload anything within your web root, place it above your html_docs instead.
    However, I'd say go with one or the other; you don't need your image to be stored in your database if you have it as a file, and vice versa. Database can still be used, but instead of the information instead save it as a path_to_image.

    All and all, I'd personally say go with the complete database route. Though I know of people whom have had problems with a database stored image, it depends on how you do it.
    First, decide on what you would like to do exactly, then we'll be able to help you script something up.

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Okay, I've decided.

    Okay. I've decided that I want to use the BLOB method. But I'm not too familiar with how it works. I'm sure if I read a couple tutorials or what not I could get the jist of it.

    Like I said before, I want registered users to be able to upload their own photos into their own personal photo gallary and it seems that using the BLOB method would be the most organized.

    Any suggestions, scriplets, or leads?


  •  

    Posting Permissions

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