in reply to Re^3: Proble with image on Perl-CGI
in thread Proble with image on Perl-CGI

i moved the 'upload' folder in to /var/www/

and in i modified the script like below

my $upload_dir = "/var/www/upload";

and

<img src="/var/www/upload/$filename" alt="Photo" />

sorry ... if i not understood..

Replies are listed 'Best First'.
Re^5: Proble with image on Perl-CGI
by lostjimmy (Chaplain) on Mar 26, 2009 at 16:44 UTC

    When you visit a website, such as http://www.example.com/upload/test.html, the web server is going to take everything after the domain (i.e. /upload/test.html), append that to what is usually called the Document Root (e.g. /var/www), and come up with a path of /var/www/upload/index.html.

    In your case, it looks like your document root is also /var/www. So, if you are uploading images into /var/www/upload/, then you want to point the browser to http://yourdomain.com/upload/$filename. You also have the option of dropping the domain and simply providing /upload/$filename.