NOT SOLVED - PROBLEM IN ACCESING FILE

Dear all,

I have a question which is driving me crazy

Kindly look the below code

In my public folder

public/Server_exe/ChatHistory/2010-01-10/2010-01-10\1~Vs~2\1~Vs~2.html => this is my live chat file path

for the above chat file images are in the following path

public/Server_exe/ChatHistory/2010-01-10/1~Vs~2/ScreenCapture/2120100109101048121.jpg => this image is shown in the chat file

<%= link_to image_tag("backup.png",:title => "view chat"),"/Server_exe/#{log.file_path}", :popup => true %>

when clicking on the above link i show the live(the files which are not moved to the archive location)chat files on a browser window these chat files are located in our rails applications public directory.this works just fine.that chat file can contain images with it.and this method properly opens a browser window and shows the chat file with images.in this case i don get any problem since it shows the chat file as it as they are.

But when i move these chat files to the archived location i wil be running into the problem

Archive location is D:/temp

so these files wiil be moved to the above location when archive functionlity is taking place.

Archived folder structure

D:\Temp\ChatHistory\2010-01-10\2010-01-10\1~Vs~2\1~Vs~2.html => this is my archived chat file path

D:\Temp\ChatHistory\2010-01-10\1~Vs~2\ScreenCapture\2120100109101048121.jpg => this image is shown in the chat file

So to view the archived chat file from the archive location i use method like below...

<%= link_to image_tag("backup.png",:title => "view chat"),{:action => "open_file",:file_path => @file_path},{:target => '_new'} %>

def open_live_file

Your question is too complex for me to fully understand without spending a lot of time examining it, however your web server will not be able to access files in d:/temp, if this is what you are trying to do (unless you have the server setup in a strange way). Generally all static files that wish to serve should stay under the public folder.

If this does not help have a look at the html that is not working and see what is wrong with it.

If that still does not help simplify the problem to one that is more easily understood and re-post.

Colin

Colin