Image Gallery Uploads

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Image Gallery Uploads

Post by mchaggis »

Hi,

I have an interestig idea/problem.

I have written a gallery application which offer the ability to upload several images at once, however, I used it myself to try and upload a gallery of a trip to scotland I'd had and soon face how annoying the application is when you have 100's of pictures to upload.

So I wrote a script that scanned a directory on the webserver for images that had not been stored in the database yet, with the plan that I could upload, via ftp, to a directory on the server. This works great for me. However, I'd like to take it to the next step....

I admin a server for my webcms sites and do not offer ftp access to these as ALL access is through a web interface, but I like the advantages of ftp for the upload of images... This got me thinking, I started wondering if it was possible to create some sort of temporary username and directory that allowed the user to click a button and then for them to upload their images via ftp, then process images and remove acess...


So, my question... Does anyone know where I would start? Has anyone done anything similar? Is there anything hat I should be aware of?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

what I would do

Post by s.dot »

What I would do is this

Code: Select all

<form action="uploadpics.php" method="post">
<input type="hidden" name="action" value="uploadpics">

for($i=0;$i<100;$i++)&#123;
<input type="file" name="filetoupload" size="50"> &#125;
<input type="submit" value="Upload">
</form>
Then upon submission of the form, use PHP to create a folder on the webserver generated with a random name. Then log that folders random name into the database in association with that person. Then when you call your image gallery script to display the folder, it will show all pics in that directory.

I hope this is what you were asking for. I couldn't really get a clear explanation of what you were trying to do.


feyd | please use the formatting tags we provide
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Post by mchaggis »

That is what I am doing at the moment.. Presently the user with about 25 file upload boxes but it is very unfriendly and time consuming when having to upload this many images.

What I am after is not so much a PHP solution I suppose, but a way to create temporary ftp users that are only available for say one session or for a time limit
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

therefor you need to read the documentation of your ftp-server. i have fe: proftpd with authentication against ldap and it's not that difficult to manage users (and the expiration date etc...)
Post Reply