hmm...

this.:

ReadParseMime();
my $filename = $in{'file_filename'};

is resulting in $filename being empty :(

Any thoughts?  full code below...

#!/opt/local/bin/perl

require 'nphos-lib.pl';

ReadParseMime();
my $filename = $in{'file_filename'};
my $filepath = "/opt/local/reddwarf/10.2.1/deploy/$filename";
ui_print_header(undef, 'NPHOS', '',undef,0,0,0,undef,undef,$bodyTags,undef);
if (!open(FILE,$filepath)){
   print ui_subheading("Error uploadinh file $filepath: $error");
} else {
   print FILE $in{'upload_file'};
   close(FILE);
   redirect("reddwarf_deploy.cgi");
   print ui_subheading("Uploaded file $filename");
}
ui_print_footer(undef,"Manage Deployment");



On Wed, Jan 12, 2011 at 1:25 PM, Jamie Cameron <jcameron@webmin.com> wrote:

You can find it in :

$in{'file_filename'}

 - Jamie 

On 12/Jan/2011 07:03 Jeffrey Kesselman <jeffpk@nphos.com> wrote ..

One more stupid Q sorry, how do I fetch the name of the uploaded file?  Is it another key on $in?

On Tue, Jan 11, 2011 at 11:09 PM, Jamie Cameron <jcameron@webmin.com> wrote:
On 11/Jan/2011 19:22 Jeffrey Kesselman <jeffpk@nphos.com> wrote ..
> I want to only allow my users to upload and delte fiels from specific
> directories so I am building my own file management interface.
>
> Is there a minimal working example of both setting up the ui_upload
> interface and handling the resulting form-data?
>
> Its all a bit greek to me right at the moment...

The code for the form would be like :

print ui_form_start("upload.cgi", "form-data");
print "Choose a file : ",ui_upload("file");
print ui_form_end([ [ "ok", "Upload" ] ]);

And for the parser upload.cgi :

ReadParseMime();
open(FILE, ">/path/to/destfile");
print FILE $in{'file'};
close(FILE);

 - Jamie

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
-
Forwarded by the Webmin development list at webmin-devel@webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel



------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
-
Forwarded by the Webmin development list at webmin-devel@webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel