Results 1 to 5 of 5

Thread: Simple photo upload script?

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple photo upload script?

    In there any such thing as a simple image upload script that I could just paste into a simple html site?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    When asking a new question, post a new thread.
    ---



    You should explain more what you mean. There is no such thing as a "simple script" that just works-- there are many scripts and some are even simple, but you need to figure out the requirements for your server.
    It's in fact very easy to write one, but you need to decide how to setup things such as where and how you want to store the photos.
    Regardless, if you just google for "php photo upload manager" or something, I'm sure you'll find results.
    But from what you said, we can't give any more specific information.

    For example, who do you want to give access to?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Didn't know anything about thread hickacking. I did google that but cant find anything that is simple enough. for me to deal with. What I would like is a script that I could paste into a simple HTML site that I built with MS. Frontpage. I like to store the images into folders labeled differently than the image folder In use for my site format. I want to set up a classified ad site where a person can write their ad in a form and upload the images to me so I can manually post the add with that images. I can set up a regular text form through frontpage but need a way to have the inages uploaded and saved on my site somehow - somehow that is simple without having to set up a data base or anything that I don't know how to do. The frontpage form just saves the text in a folder then emails me a notice. Could I get a simple script to do that with imaged?
    Tom

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    As I said, there is no simple script for image uploading because it's not a simple process.

    If you are using frontpage that is an entirely different system from PHP. While it's not impossible to use both on the same server, I believe it is impossible [maybe very difficult] to use PHP and frontpage to parse a single form submission (though maybe this would work, but it would be complex and more work than required normally).

    What I suggest is becoming familiar with PHP and working on the script yourself, or possibly hiring someone to do it if you must.
    While it would not be that difficult to set this up for someone who knows PHP, it would take some time and it might be difficult making it interact with your website in the proper way.

    Uploading is, in theory, just like submitting a regular form, but several variables become more complex and one of those is security.

    Here's a tutorial (based on a quick google search):
    http://www.tizag.com/phpT/fileupload.php

    The only real security you need to worry about is this:
    1. Set a maximum file size both in the form and on the server-- if the file submitted is over Xkb, then just refuse the upload. Since you are just allowing images, 1mb should be fine, or perhaps if you want very large images, 2mb.
    2. Never allow files like .php to be uploaded because this can compromise your server's security. It is not possible to guess what sorts of 'bad' files people might upload, so to be secure use an "OK list" of filetypes, and only allow those-- don't try to guess which ones to block. So verify the filename against '.gif, .jpg, .jpeg, .jpe, .png, .bmp' (etc) and you'll be fine. Even if they upload a "bad file" as a .gif etc it won't actually process on your server as anything so it won't hurt. [It is possible, but much more difficult, to actually verify that the data of the file is an image, but this is not really worth the time.]


    Once you are into advanced concepts like this, it's better to think of commands (such as functions) than scripts, because the typical idea of a "script" is that it's a piece of code that 'does something', and at this level you rarely want a prebuilt script because it won't fit your needs-- what you need to do is organize functions in a certain way so that what they do happens in the right order at the right time. Functions are like small scripts, then, that interact to create a 'big script'.
    It's certainly possible to find a 'script' in PHP, but rare that it fits exactly what you want.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Question

    What would you want to set something up like that for me? What I need is something like what cragslist uses to allow someone to post an ad with images; Here's an example URL: https://post.craigslist.org/col/S/boa/none/x
    I could set up a basic site and let you into the cpanel. I would need something that does all those things and one the I can just paste into as many pages as I would like.
    Tom

Bookmarks

Posting Permissions

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