in reply to uploading

In order to upload a file, you must have at least the following in your HTML (this is just off the top of my head):

<form enctype="multipart/form-data" method="post"> <input type="file" name="somefile"> <input type="submit"> </form>

The reason you must have that is because then the user must actively select a file to upload by either browsing for the file or input the file path and name into the input box. If you could just supply the filename in a cookie, this would be a major security hole because you could silently upload files without the user's consent.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: (Ovid) Re: uploading
by PriNet (Monk) on Feb 25, 2002 at 22:46 UTC
    will this allow me to select more than 'one' file at a time? (i trying to upload a whole directory of 'pictures' for a gallery page)... thanx ovid...this points me in the right direction anyway.....

      Sorry, you can't upload a directory, either. What you want to do is either have multiple <input type="file"...> fields or have your users create a tarball or zip archive of the files and then upload the archive.

      Cheers,
      Ovid

      Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

        thanx...that helps...... if you guys can keep this site 'up' (lol) it's the best one i found yet for perl help.....

      html doesn't provide a way for the user to select an entire directory or multiple files for upload at once. the best you can do is have multiple <input type="file"> elements and have the user go through and select each file they want to upload individually. other than that, pretty much all you can do is either require the user to zip the directory they want and upload the zip file, or you can set up an ftp server that they can copy their files to.

      anders pearson

        i have my own ftp server at my disposal...thats another approach...thanx guys