View previous topic :: View next topic |
Author |
Message |
718aba -
Joined: 17 Jun 2005 Posts: 1
|
Posted: Fri Jun 17, 2005 3:12 pm Post subject: CGI Script (Upload) not working ... |
|
|
Hi!
I tried to enable uploading to the web server with the following script, I've found on the Net (modifying some variables) (I do not have experiences with cgi!). It seemed to work, the 'Thanks' page appears, but the file was not uploaded. Someone can help me to find the problem? (The cgi-log does not show anyting). The '/perl' path points to the Perl installation root path, not the 'bin' path.
[Script]
#!/perl
use CGI;
$upload_dir = "/upload";
$query = new CGI;
$filename = $query->param("fname");
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("fname");
open UPLOADFILE, ">$upload_dir/$filename";
# binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;
print $query->header ( );
print <<"(FIM)";
<HTML>
<HEAD>
<TITLE>Thanks!</TITLE>
</HEAD>
<BODY>
<P>Thanks for uploading the file!</P>
</BODY>
</HTML>
(FIM)
[End of Script]
Thank you |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jun 18, 2005 11:34 am Post subject: Re: CGI Script (Upload) not working ... |
|
|
718aba,
The variable $upload_dir
Code: |
$upload_dir = "/upload";
|
should be set to an existent full path on your hard drive. /upload is not a good path if you're on Windows and does not exist if you're on another operating system. Set it for example to "c:\\upload" (note the double \).
[code]
# binmode UPLOADFILE;
[code]
should be uncommented (remove #).
If it is still not working please send the script and your abyss.conf file to support@aprelium.com . Do not forget to add a reference to this forum message. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|