Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Reference To Files

Recommended Posts

I have been writing my first CGI program, but had problems loading images and background files.I needed to write:-Code:cout << "<body background=\"file:///C:\\GoAhead\\ws031202\\web\\cgi-bin\\images\\MyBackground.jpg\">"to get the images loaded.i.e. the following line did not work:-Code:cout << "<body background=\"http//C:\\GoAhead\\ws031202\\web\\cgi-bin\\images\\MyBackground.jpg\">"Can someone explane the difference for me please.I could never use relative references:-e.g.Code:cout << "<body background=MyBackground.jpg\">"Many thanks, kvarnerexpress

Share this post


Link to post
Share on other sites

file:/// and http:// are different protocols. When you say file:/// it will automatically search the file system on the computer for the path. When you say http:// it will assume that it's a file on the internet. It's just how stuff is recognized-  http:// doesn't work because C:\ isn't a website.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.