Re: cgi upload -> XMLin

2008-02-13 Thread Jay Savage
On Feb 13, 2008 12:52 AM, Brent Clark <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: > > > The XMLin method takes a string, file, or file handle as its argument. > > Just pass $upload_filehandle to it: > > > > my $ref = $xs->XMLin($cgi->upload("f

Re: cgi upload -> XMLin

2008-02-13 Thread Brent Clark
Chas. Owens wrote: The XMLin method takes a string, file, or file handle as its argument. Just pass $upload_filehandle to it: my $ref = $xs->XMLin($cgi->upload("filename")); print $xs->XMLout($ref); Hi Thanks for replying. To be honest, I did try that, but then i was ge

Re: cgi upload -> XMLin

2008-02-12 Thread Gunnar Hjalmarsson
(). If you mean that you don't want any temporary files to be used, it can't be done, at least not as long as you use CGI.pm for the upload. CGI::upload() creates a temporary file in $CGITempFile::TMPDIRECTORY, and the returned filehandle refers to that file. -- Gunnar Hjalmarsson E

Re: cgi upload -> XMLin

2008-02-12 Thread Chas. Owens
, and heres my > working code. > > my $filename = $cgi->param("filename"); > #my $filename =~ s/.*[\/\\](.*)/$1/; > my $upload_filehandle = $cgi->upload("filename"); snip > #my $xs = new XML::Simple( keeproot =>

cgi upload -> XMLin

2008-02-12 Thread Brent Clark
filename =~ s/.*[\/\\](.*)/$1/; my $upload_filehandle = $cgi->upload("filename"); =begin # YUCK !!! #my $upload_dir = "/tmp"; #open UPLOADFILE, ">$upload_dir/$filename"; binmode UPLOADFILE; while ( <$uploa

Re: CGI upload problem on IE

2005-01-29 Thread Bob Showalter
Yw Chan ( Cai Lun e-Business ) wrote: However, the situation is that ehe spaces not from my filename but from the Windows XP default of C:\Documents and Settings\Default user\. etc. I guess in an overwhelming web-based environment using Windows at the browser side, most people would come across

Re: CGI upload problem on IE

2005-01-29 Thread Bob Showalter
Yw Chan ( Cai Lun e-Business ) wrote: However, the situation is that ehe spaces not from my filename but from the Windows XP default of C:\Documents and Settings\Default user\. etc. I guess in an overwhelming web-based environment using Windows at the browser side, most people would come across

Re: CGI upload problem on IE

2005-01-29 Thread Yw Chan ( Cai Lun e-Business )
However, the situation is that ehe spaces not from my filename but from the Windows XP default of C:\Documents and Settings\Default user\. etc. I guess in an overwhelming web-based environment using Windows at the browser side, most people would come across this issue. I'm wondering if ther

Re: CGI upload problem on IE

2005-01-29 Thread Alfred Vahau
> Unix allows spaces in file names. Agree. But for a Unix-centric person like me operating in an otherwise all Windows environment, I've found that the use of space in Windows filenames is more liberal than in Unix in so far as the use of commands go. So for anyone starting with Windows and headi

Re: CGI upload problem on IE

2005-01-29 Thread Bob Showalter
Alfred Vahau wrote: Hi, My workaround in Windows to the space in file names (which the *nix don't allow) are the following: Huh? Unix allows spaces in file names. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: CGI upload problem on IE

2005-01-29 Thread Alfred Vahau
Hi, My workaround in Windows to the space in file names (which the *nix don't allow) are the following: (1) Use an underscore instead of space in file names (2) Surround the file name with quotes if spaces are retained (3) Use the hex representation of space (%20) in file names HTH, alfred, Yw Ch

CGI upload problem on IE

2005-01-29 Thread Yw Chan ( Cai Lun e-Business )
Hi, I'm trying to write a CGI using perl for uploading multiple files, here's my part of codes. == my @fax_files = map(symlink($query->tmpFileName($_), "/tmp/fax_$_") ? "/tmp/fax_$_" : (), $query->upload("files")); === I guess on IE, the browser re

RE: Cgi upload

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, Paul Kraus said: >I have one question though using the while ( <$fh> ) >Works great. Is there a reason I would want to do while (read ( $fh, >$buffer, $buffer_size) If you want to read the optimal number of bytes at a time. In a simple application, there's really no reason to do one ov

RE: Cgi upload

2003-09-09 Thread Paul Kraus
buffer, $buffer_size) Is there an advantage to either one of these? -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 11:48 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Cgi upload > This should be a simple little script. > > Bu

RE: Cgi upload

2003-09-09 Thread Dan Muey
strict; > use warnings; > use CGI; > use constant BUFFER_SIZE => 16_384; > my $cgi = new CGI; > my $buffer = ""; > my $file = $cgi -> param ( 'file' ); > my $fh = $cgi -> upload ( $file ); > open ( OUT , ">incomingfile" ) || die ( &qu

Re: Cgi upload

2003-09-09 Thread Jeff 'japhy' Pinyan
my $cgi = new CGI; >my $buffer = ""; >my $file = $cgi -> param ( 'file' ); >my $fh = $cgi -> upload ( $file ); That's not how uploading works. You don't use the 'upload' method to physically upload a file, you use it to access the form field t

Cgi upload

2003-09-09 Thread Paul Kraus
i = new CGI; my $buffer = ""; my $file = $cgi -> param ( 'file' ); my $fh = $cgi -> upload ( $file ); open ( OUT , ">incomingfile" ) || die ( "Could not open output file"); while ( read ( $fh, $buffer, BUFFER_SIZE ) ) { print OUT $buffer; } close