HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
How to show image from FTP server on the HTML page
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML
View previous topic :: View next topic  
Author Message
jeremycod



Joined: 10 May 2008
Posts: 2

PostPosted: Sat May 10, 2008 7:15 am     How to show image from FTP server on the HTML page Reply with quote

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

PostPosted: Mon May 12, 2008 3:34 am     Reply with quote

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

PostPosted: Tue May 13, 2008 12:32 am     Reply with quote

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

PostPosted: Tue May 13, 2008 8:55 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial