ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Unable to write to files using CGI
by Alejandro Santillan Iturres other posts by this author
Mar 31 2008 6:54PM messages near this date
Re: ActivePerl 5.10 and Oracle/ODBC | Re: Unable to write to files using CGI
I have a CGI script that worked perfect for several years that writes  
contents of a file from the web on one webserver.
I am setting a new web server, and running this time the same script  
but under https instead of http.
The script is very simple:


#!/usr/bin/perl
use CGI;
my $q = new CGI;
print $q-> header();

$user = $q-> param('user');
$pass = $q-> param('pass');

if($user eq "Eduard" && $pass eq "xxxxx"){
$filecontents = $q-> param('filecontents');

open(FILE,"> /home/server/file.txt") or die;
print FILE $filecontents;
close(FILE);

print "hi $user!";
}
else{print "You are not authorized!"}

So, you provide something like:
http://somewebserver.com/cgi-bin/xxx.cgi?user=Eduard&pass=xxxxx&filecontents=somedatakdfjlsd
kf
This way, it should create a file called "file.txt" at the directory / 
home/server/file.txt

In the new server under https I do:
https://somewebserver.com/cgi-bin/xxx.cgi?user=Eduard&pass=xxxxx&filecontents=somedatakdfjls
dkf
But now nothing happens. The script writes only once hi Eduard!

The second print is ignored and I am not able to write or modify the  
file.
I don't know if this happens because of the https. I've set the  
permissions of /home/server dir to 777, and also the same for all  
files inside the directory, but
I cannot write a file inside this directory.

What should I do to know what's going wrong?

Any help appreciated!

Best regards,

Alejandro


_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Alejandro Santillan Iturres
Francisco Zarabozo
David Christensen
Bill Luebkert
Andy Bach
Alejandro Santillan Iturres

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved