NetTalk Central

Author Topic: Images and their relative paths - help please  (Read 4324 times)

johanl

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Images and their relative paths - help please
« on: September 21, 2012, 03:57:54 AM »
Hello

I build up a list of images and their desciptions in a memory file and display them in a ntws browse.

I upload the images to the web\uploads directory and can physically see them there but when I say .\web\uploads\image1.jpg no image is displayed but if I say .\uploads an image is displayed but that path does not event exist.

Where am i going wrong with this?

Regards
Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Images and their relative paths - help please
« Reply #1 on: September 21, 2012, 04:15:12 AM »
the path for static files is relative to web.
In other words
images\whatever.png
is really
c:\something\web\images\whatever.png

cheers
Bruce

johanl

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Images and their relative paths - help please
« Reply #2 on: September 21, 2012, 07:22:27 AM »
Hello Bruce

Are images stored in temporary files somewhere on disk as I display the image and the change the physical image but the old one remains?

Johan

johanl

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Images and their relative paths - help please
« Reply #3 on: September 21, 2012, 07:47:39 AM »
Hello Bruce

Another dumb question in the followup to my previous one I build up an im-memory table of the images that I want to display. I copy them to the web\images directory (they are copied correctly), how do I then reference them?

A like this:  .\web\Images\DS07137-015.jpg
B Like this:  Images\DS07137-015.jpg

because currently only option B displays an image but that is like I said in my post 3 - a ghost image of a previous test not the one copied to the images folder.

Johan


kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Images and their relative paths - help please
« Reply #4 on: September 23, 2012, 02:57:01 AM »
B

Try to refresh your browse as the image may be cached.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Images and their relative paths - help please
« Reply #5 on: September 24, 2012, 12:05:32 AM »
Johan,

the images are almost certainly begin cached in the browser.
You can refresh your browser page (ie get the images again) by pressing Ctrl-F5 in the browser.

There are ways to get ti to _not_ cache the image, if you need to go that route, just ask.

cheers
Bruce

johanl

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Images and their relative paths - help please
« Reply #6 on: September 24, 2012, 03:09:52 AM »
Hello Bruce

Correct image was cached, please explain to me how to change this

Johan

johanl

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Images and their relative paths - help please
« Reply #7 on: September 24, 2012, 03:10:35 AM »
Thanks Kevin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Images and their relative paths - help please
« Reply #8 on: September 24, 2012, 06:02:14 AM »
in WebHandler,
_SendFile method
set

self.ForceNoCache = true

but you'll want to check the filename, because you definitly want to cache as many static files (.js, .css, .png etc) as possible. So only turn this on for a very small number of files.

cheers
Bruce