How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system?
相关问题
- $ENV{$variable} in perl
- Upload file to Google Cloud Storage using AngularJ
- Is it possible to pass command-line arguments to @
- Redirecting STDOUT and STDERR to a file, except fo
- Change first key of multi-dimensional Hash in perl
相关文章
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- File Upload of more than 4GB
- The current request is not a multipart request - S
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- Input file in laravel 5.2?
- Lazy (ungreedy) matching multiple groups using reg
See the CGI.pm documentation for file uploads.
I'd start by using CGI and reading CREATING A FILE UPLOAD FIELD, and using open to create a file and print to write to it. (and then close to close it).
Use the CGI module.
Just a note: however you will write it, don't save it in a place accessible from your web-server.
And now to the point: below is a script which I was using for some time for photo-uploading. It might need some tweaking, but should show you the way.
As the image isnt uploaded to web-accesible directory, we then have separate process checking it, resizing, putting a watermark and placing it where it can be accessed.