Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Script for uploading files to a server

Reply
Thread Tools

Script for uploading files to a server

 
 
Grega
Guest
Posts: n/a
 
      10-23-2008
Hi!

I use the following script for saving the uploaded file to the server.
It is basically driving me mad!
($q is initialised before)

my $sourceFilePath = $q->param('pdf');
my $fileHandle = $q->upload('pdf');
open (OUT, ">test.pdf") or die "$!";
binmode OUT;
while(<$fileHandle>){
print OUT;
}
close OUT;


What is the basic problem - $fileHandle seems to be empty while
$sourceFilePath holds the correct filename! I am stuck with this
problem for some time now :/

I have the current version of the CGI module.

Thank you in advance!
 
Reply With Quote
 
 
 
 
Joost Diepenmaat
Guest
Posts: n/a
 
      10-23-2008
Grega <(E-Mail Removed)> writes:


> What is the basic problem - $fileHandle seems to be empty while
> $sourceFilePath holds the correct filename! I am stuck with this
> problem for some time now :/


99% chance you're not using <form enctype="multipart/form-data">

See http://www.w3.org/TR/html401/interact/forms.html#h-17.3

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
 
Reply With Quote
 
 
 
 
Grega
Guest
Posts: n/a
 
      10-23-2008
> 99% chance you're not using <form enctype="multipart/form-data">
>
> Seehttp://www.w3.org/TR/html401/interact/forms.html#h-17.3
>


IT WORKED!

You cannot imagine how grateful I am. To my assumptions I spend ~20
hours solving this simple bug :/
The whole problem is, that I am editing a web service written a long
time ago by someone else..

Thanks again!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp uploading vs. control panel uploading Dung Ping HTML 10 01-16-2006 10:43 AM
Uploading files to Windows Server raymond chiu ASP .Net 2 01-12-2006 06:10 PM
Problems: uploading files have Chinese named files Andrew Chan ASP .Net Web Services 0 04-16-2004 07:50 AM
Uploading files with cgi - binary-files are truncated !? dermoon Python 0 10-08-2003 10:21 PM
Uploading files up to 150MB onto server Rosie Chua ASP .Net 3 06-26-2003 05:20 AM



Advertisments