From: Jamie C. <jca...@we...> - 2002-11-02 00:56:47
|
Gehrigal - Webminprojects wrote: > Hi All! > > 1.Is there a common function to upload and saving files? > I only found the file_chooser_button function. There is no function for this, but it is pretty simple. You just need to create a form like : <form action=upload.cgi method=post enctype=multipart/form-data> <input type=file name=data> </form> And then in upload.cgi, call the &ReadParseMime(); function instead of the usual ReadParse. The contents of the uploaded file will be available in $in{'data'} > 2. I Create a module, that creates a file. This file yould be downloaded by > webminuser. How can i do this? My usual solution is to have a CGI program output a MIME content-type header that is not viewable by the browser, like so : #!/usr/bin/perl print "Content-type: application/octet-stream\n\n"; print $contents_of_the_file; This will force the browser to open a 'save file' window .. - Jamie |