|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
hi,
i have a cgi-script that is suppose to decode a mime-message and write it to a temporary file. It runs well at the prompt but when i try it through the browser it does not write to the file. I've set debug like this: unless (open (EP,"/var/tmp/message.msg")) { print "Cannot access file"; } and the browser returs Cannot return file. Can anynone please tell me how to write to a file on the hard disk from the cgi script. and if there are any settings that need to be specified within the cgi script. Its really urgent thank you; |
|
#2
|
|||
|
|||
|
Well you should write it like this:
open(EP,"/var/tmp/message.msg") | | print "Cannot access file - $!"; That's a much better way than an unless statement. Another thing you can do is add a check to see if got access to exists/read/write the file. Exist would be done like this: unless(-e $file){die "Error Message"} |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > What is needs to be decalred in a cgi script read and write to a file. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|