Script for uploading files to a server

Discussion in 'Perl Misc' started by Grega, Oct 23, 2008.

  1. Grega

    Grega Guest

    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!
     
    Grega, Oct 23, 2008
    #1
    1. Advertising

  2. Joost Diepenmaat, Oct 23, 2008
    #2
    1. Advertising

  3. Grega

    Grega Guest

    > 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!
     
    Grega, Oct 23, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. raymond chiu

    Uploading files to Windows Server

    raymond chiu, Jan 6, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    511
    =?Utf-8?B?Tm90SGVscGZ1bA==?=
    Jan 12, 2006
  2. Rosie Chua

    Uploading files up to 150MB onto server

    Rosie Chua, Jun 26, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,398
    Russ Bishop
    Jun 26, 2003
  3. Dung Ping
    Replies:
    10
    Views:
    990
    Chaddy2222
    Jan 16, 2006
  4. dermoon
    Replies:
    0
    Views:
    483
    dermoon
    Oct 8, 2003
  5. Andrew Chan

    Problems: uploading files have Chinese named files

    Andrew Chan, Apr 16, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    183
    Andrew Chan
    Apr 16, 2004
Loading...

Share This Page