 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
jeremycod
Joined: 10 May 2008 Posts: 2
|
Posted: Sat May 10, 2008 7:15 am How to show image from FTP server on the HTML page |
|
|
|
Hi,
I'm using FileZilla server to store files and images uploaded by FTP client from remote client. It works fine, but I want to use those images in PHP application and nest it inside php page with "<img src=...". My application is aware of the name of the image that should be shown but I don't know how to get its path.
Zoran |
|
rsleventhal

Joined: 19 Mar 2008 Posts: 20
|
Posted: Mon May 12, 2008 3:34 am |
|
|
|
Hi Zoran,
Where, on the remote site, are you FTPing to?
On one server where I have some sites, the login drops me in my personal folder from where I must cd to /var/www/html/ (the root of my site). On another, it's ./public_html/. Basically, it depends on the server-side setup, but once you know where the root folder of your website is (in relationship to where you are 'dropped' when you log in to the server via ftp), you're good to go.
If you are not certain where your 'web root' directory is, ask your host. I'd guess that wherever that is you'll want an images/ folder into which you'd place your graphics.
Please let me know if you need more to work from to get this going.
Regards,
-Ray |
|
jeremycod
Joined: 10 May 2008 Posts: 2
|
Posted: Tue May 13, 2008 12:32 am |
|
|
|
Hi Ray,
Currently, I'm working my own research on my PC, so both Tomcat and FileZilla FTP server are on the same PC. I have solved it by creating my application's user on FTP server and creating an image's folder in web root directory for it, so images are available through http. But, I want to be sure that if it will work later when I try to put my application on some host provider. Or, what will happen if I have Web server and FTP server on two different providers?
Zoran |
|
rsleventhal

Joined: 19 Mar 2008 Posts: 20
|
Posted: Tue May 13, 2008 8:55 am |
|
|
|
Hi Zoran,
To preserve portability, your code should always be relative to the root of your web. So...if you have images, it would make sense to make a folder called images in the root. Then when you need to access them in a browser, you'd link to:
/images/<imagename.jpg>
Doing this, you can move from server to server if you need to with little or no tinkering to get things to work.
HTH,
-Ray |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|