CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Problems uploading a file...



Aug 15, 2000, 6:13 AM

Post #1 of 3 (429 views)
Problems uploading a file... Can't Post

I am having problems uploading a file using this as the main part of my upload code:

while ($bytes_read=read($filepath,$buff,2096))
$size += $bytes_read;
binmode WFD;
print WFD $buff;

if ((stat $write_file)[7] <= 0)
&printError("Could not upload file: $filename");

The error it kicks out is "Could not upload file: <filename>" I was running it on a Netscape Web server with no problems. When I moved it to a different machine with an Oracle Web server I started having problems. Are there problems with the code or are there things that have to be set up with the server for this to work? Thanks!

[This message has been edited by ebloch (edited 08-15-2000).]


Aug 15, 2000, 11:04 PM

Post #2 of 3 (429 views)
Re: Problems uploading a file... [In reply to] Can't Post

Some web servers have intersting notions of what the working directory is for a CGI. For Oracle's web server, you may need to verify that you're starting where you think you are. You might be starting in a directory you don't have write access to.

Did you check for errors when you opened the file for writing?


Aug 16, 2000, 4:45 AM

Post #3 of 3 (429 views)
Re: Problems uploading a file... [In reply to] Can't Post

Thanks for the reply! Yes, I check for errors when I open the file for writing. What I think the problem is is that it can't open the file it needs to read to start uploading it. I've tried several different files but I still get the same thing then I run the script on the other server and it works fine with any of the files!


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives