Forum Moderators: coopster
I told him I thought this wasn't possible, but I like the idea.
I searched the net and all I found was that it is impossible to retreive data from a local folder.
e.g. readdir only reads dirs from the server, it I could somehow index the local folder, I could loop the files tp upload, but this seems to be impossible to do.
I was wondering if anybody has any experience or info on getting files from a clients hard disk?
First you clould ask the client to create in a easy location a new dir "my_uploads"
so we know where it is located
Ask him to copy the dir to be uploaded in the "my_uploads" dir
Next open the local dir using opendir()
Grab all file names and extension
Use copy() to copy file/s
since you know $source and $destination
you might be in business
needs to work on it but it might (at very first glance!) work.
Since so far it seems impossible to read the folder from users HD, for now they will get a single file upload option.
With the additional option to upload a Zip containing several images, which is automatically unzipped on the server.
[edited by: StickeR at 1:13 am (utc) on Aug. 20, 2006]
Ask them to press 'continue' when the upload is complete.
Use PHP to take that FTP uploaded folder (most of them won't even know it was an FTP upload they just did!) and move it wherever it is meant to be.
Option 2 (Requires Basic Technical Expertise):
Ask them to right click the folder and Send to -> Compressed folder. This (zip) file can now be uploaded as a single file. PHP can open the zip file, but I recommend just using a shell command, something like `unzip file.zip` to do it once uploaded
Option 3 (Requires software installation):
Build a small downloadable app to undertake the steps involve in option 2. If it's a commonly undertaken action have it added to the 'send to' context-menu list (Send to -> YourService). If it's only a once-in-a-while task then have them 'browse for folder' in the downloaded app, click okay, and watch the file transfers zip past. Many ways to do the upload here, I'd recommend zipping it and transfering it by POST/multipart-form encoding.