View Full Version : Uploading dirs (multiple files) - browsin' the local filesystem

02-14-2003, 01:25 AM
I made a script to update my site that actually deletes some files and rename some directories. As I couldn't get it to delete these files using the unlink function, I have gone with the ftp functions, and placed the script under a 'secure' directory (.htaccess) to prevent leaking my ftp login/passwd.

I would like to upload a dir that contains a lot of files (pictures) and another subdir that also contain a lot of files (thumbnails).

Is there anyway to use the script to browse my local disk, get the file names and put them using FTP?

No trouble using the ftp_ functions, just dont know how to (if possible) read the contents of some directory in my local hard disk.

02-16-2003, 10:20 PM
You are not the first one to come across this problem :)

I've been successful in reading a dir for all its files using ActiveX.

But then I came across another problem. You can't change the values of an <input type=file>. You can't:

a) <input type=file value=File>, it won't accept the value field

b) <body onload=getElementById('fileField').value='File'>
<input type=file id=fileField>
</body>, It will also do nothing.

File fields are not programable, mostly for security reasons, as you would be able to retrieve things from users computers without their permission.