View Full Version : Simple photo upload script?
Lizard
03-13-2010, 10:12 AM
In there any such thing as a simple image upload script that I could just paste into a simple html site?
djr33
03-14-2010, 05:53 AM
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?
Lizard
03-15-2010, 10:29 AM
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
djr33
03-15-2010, 02:05 PM
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.
Lizard
03-15-2010, 09:43 PM
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
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.