mortimerdude Posted May 6, 2009 Share Posted May 6, 2009 Basically I have a folder of about 500 pictures (hi res, <100k each) and a folder in there of thumbnails of another 500 pictures (low res, <20k each). Instead of having to upload them and then input each file individually. I'm trying to create a script that allows me to pick the folder, upload all the images inside and store the file names to a database. Any one have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/157147-php-folder-uploader-database-store/ Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 Use glob to echo all the filenames as a sql insert statement. Then ftp the 500 pictures to the server and run the generated sql insert statements to add them to the DB, as I take it this is a one time deal, it can be that simple. Quote Link to comment https://forums.phpfreaks.com/topic/157147-php-folder-uploader-database-store/#findComment-828045 Share on other sites More sharing options...
mortimerdude Posted May 6, 2009 Author Share Posted May 6, 2009 No. I'm a developer and a photographer. Basically I'm creating an online photo proof/ordering forum for clients to see thumbnails, click (using javascript) open the full res. Fill out their order of different size of prints for each images and possible comments on what/how they want the photo edited. I have all that figured out, but NOT the way to store all the files names in the database. And since each time its usually over 500 photos its not worth doing one at a time. Got a suggestions on a more "permanent" setup? Quote Link to comment https://forums.phpfreaks.com/topic/157147-php-folder-uploader-database-store/#findComment-828051 Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 Unfortunately PHP/HTML does not have a way for you to upload entire folders. You have to choose it file by file. However, Java, has this functionality. Java Uploader Since, you are a developer/photographer, I bet you can get the java uploader to work. But what you need to do after the files are uploaded is run a script to import the names/file locations into the database. To do this you need some knowledge of PHP and how to use a function like glob and knowledge of MySQL so how to run/execute the query for each file. If you do not know how to do this, sorry, I am not for coding it for you, you can post in the freelance section and offer to pay someone to implement it for you. Or you can try reading up on PHP and MySQL and coding it yourself. Hope that at least gets you on the right track. Quote Link to comment https://forums.phpfreaks.com/topic/157147-php-folder-uploader-database-store/#findComment-828057 Share on other sites More sharing options...
mortimerdude Posted May 6, 2009 Author Share Posted May 6, 2009 thats what i needed. thanks for the javascript suggestion. didn't even think to look there for an uploader. ill have to set up the scripts this weekend. i couldn't figure out how to get the file names into the database with out a crazy amount of code but glob, that should work. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/157147-php-folder-uploader-database-store/#findComment-828068 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.