|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Im using the GD.pm library to greate some dynamic graphics. I've got the graphics working but I can't get the open() function to save the genrated graphic to the right directory. It will save to the working directory which is /cgi-local but I want it to go in my /webdesign/images directory.
this works: $gif_data = $image->gif; open (GIF,'>pic.gif') | | die; print GIF $gif_data; close GIF; it creates the file pic.gif in my cgi-local directory but if I try: $gif_data = $image->gif; open (GIF,'>/webdesign/images/pic.gif') | | die; print GIF $gif_data; close GIF; It bombs on me. I tried working through the documentation on perl.org but found it very confusing. I'm just learning so I apologise for bombarding the forum with questions. I really appreciate all the help everyone has provided. BAG |
|
#2
|
|||
|
|||
|
Define 'bombs'... what error does it give you?
You must make sure that your /webdesign/images directory is chmoded to 777 so it has permission to create a file there. At a shell prompt, type the following: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>cd /webdesign chmod 777 images[/quote] And that should give it the required permissions... |
|
#3
|
|||
|
|||
|
Internal Server Error.
|
|
#4
|
|||
|
|||
|
Can you find out what error you get by running it manually by telnetting to the server and running perl yourscript.pl? That should give you a much more descriptive error message. If you can't do that, try chmoding the images directory to 777 (you should be able to do this with your FTP client, something like "Change Permissions")
|
|
#5
|
|||
|
|||
|
um...
instead of your current code: open (GIF,'>/webdesign/images/pic.gif') | | die; try something like this? open (GIF,'>../webdesign/images/pic.gif') | | die; i've had problems like that. just cruise directly to it? ??? just a thought? ---------------------------------- <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by cbolt: Define 'bombs'... what error does it give you? You must make sure that your /webdesign/images directory is chmoded to 777 so it has permission to create a file there. At a shell prompt, type the following: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>cd /webdesign chmod 777 images[/quote] And that should give it the required permissions...[/quote] |
|
#6
|
|||
|
|||
|
Off topic a little, are the images coming out fine? Even without going into binmode to write the file? (I don't know the GD.pm module)
[This message has been edited by Imo (edited January 15, 2000).] |
|
#7
|
|||
|
|||
|
Imo. The images come out fine GD.pm is pretty easy to use.
I got it working actually, I forgot to put the .. before the path. I'm an idiot. Thanks for everyone's help. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > The open() function is driving me nuts!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|