hello perlmonks, everybody!
I am currently working on a intranet website in our company and still learning on web and perl programming.
I have a website on a unix apache2 server with perl installed and there's an FTP option in my webpage to get archive files from an ftp server.
I use perl cgi NET::FTP module, with username,password provided at script and filename from the html form.
To check if my cgi perl ftp script runs at unix, i hardcoded the username/password/target file at ftp server and run it and works fine (can get the target file).
But when i try to run my cgi perl ftp script (with username/password/target file hardcoded) thru my website, i get error 500 Internal Server Error then i check the error logs and shows me below.
My cgi perl ftp script with username/password/target file hardcoded:"...Cannot open Local file "target_file": Permission denied, referer: +http://www.???.com/get_FILE.html "...malformed header from script. Bad header=retrieving file from serv +er: get.cgi, referer: http://www.???.com/get_FILE.html
#!/usr/bin/perl -wT use Net::FTP; print "retrieving file from server\n"; $ftpobj = Net::FTP -> new ("100.eee.yyy.xxx"); $ftpobj -> login("user","pass"); $ftpobj -> cwd ("target_directory"); $ftpobj -> get ("target_file"); $ftpobj -> quit; print "file size ",-s "target_file"," bytes\n";
Can you help me out guys? I've put the permissions to 777 of the script and the directory but still same error "permission denied... :(
Thanks!
In reply to cgi perl ftp question by viper1503
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |