Viewing images in my CGI-BIN

R

Robert TV

Hello, I am writing a perl script that uploads images from my computer to my
web site. The images get dumped inside a special forder in my cgi-bin. For
some reason, once the images have arrived, they cannot be viewed in my
browser. The URL is have entered are correct, but they always show up
broken. If I use my ftp program to move the images out of the cgi-bin and
into a normal html forlder they appear fine. I have also played with the
file permissions of the images when in the cgi-bin, but to no avail. Can
anyone help me? TAI

Robert
 
E

Eric Bohlman

Hello, I am writing a perl script that uploads images from my computer
to my web site. The images get dumped inside a special forder in my
cgi-bin. For some reason, once the images have arrived, they cannot be
viewed in my browser. The URL is have entered are correct, but they
always show up broken. If I use my ftp program to move the images out
of the cgi-bin and into a normal html forlder they appear fine. I have
also played with the file permissions of the images when in the
cgi-bin, but to no avail. Can anyone help me? TAI

It's a web-server configuration issue, nothing Perl-specific. Web servers
are normally configured to map URLs that point into a CGI directory or
subdirectory into requests to execute code rather than to deliver files.
And there are good reasons for this to be so. If you want uploaded files
to be immediately servable, your upload handler needs to put them somewhere
they can be served from. It's that simple.
 
A

A. Sinan Unur

Hello, I am writing a perl script that uploads images from my computer
to my web site. The images get dumped inside a special forder in my
cgi-bin. For some reason, once the images have arrived, they cannot be
viewed in my browser. The URL is have entered are correct, but they
always show up broken. If I use my ftp program to move the images out
of the cgi-bin and into a normal html forlder they appear fine. I have
also played with the file permissions of the images when in the
cgi-bin, but to no avail. Can anyone help me? TAI

This has absolutely nothing to do with Perl.

Most probably, your web server is configured to treat everything in cgi-bin
as a program to be run. It is generally a good idea to keep content and
executable locations separate.
 
E

Eric Bohlman

It's a web-server configuration issue, nothing Perl-specific. Web
servers are normally configured to map URLs that point into a CGI
directory or subdirectory into requests to execute code rather than to
deliver files. And there are good reasons for this to be so. If you
want uploaded files to be immediately servable, your upload handler
needs to put them somewhere they can be served from. It's that
simple.

P.S. Any further discussion of this should take place in
comp.infosystems.www.authoring.cgi, since it's not Perl-specific.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top