Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questions and problems about links to files. 1

Status
Not open for further replies.

EdRev

Programmer
Aug 29, 2000
510
US
On my web page is a link (a href="//server/....somedoc.doc) to an excel or word document. When the link is clicked, the document is opened and an instance of that file is created as well with in that directory the name ~$edoc.doc
Is there a way that I could code in my link not to create this file? I am using filesystemobject and I will have multiple files being displayed as my users starts clicking away on the files.

Also, although I have this code <a href="//server/....somedoc.doc target = "descriptions">, the excel and word open up in another window. txt files open up on the "descriptions" frame. Does it respect user's folder options..file types..browse in same window setting?

I also have a link to an active logfile (that is constantly updated by a batch job running behind the scene), once the link is clicked the date last modified of the logfile does not change anymore until the batch job is finished (release the file).
This means my user would not be able to view an updated logfile. There is hotfix for this in Microsoft but for Windows XP, not for Windows 2003 server OS. Is there a way to get around this?

 
OK first things first.. have you got that url correct: //server/.....somedoc.doc - or have you got \\server\.....somedoc.doc ?

The ~$edoc.doc or similar ~$... files are a temporary workfile created by Microsoft Word whenever you open a document up - check it out on your own PC (make sure you set the folder view to view hidden files etc).

The reason this may happen here (if using the \\server\.. path name) as it does on your pc is because \\server\share\file.name is basically a shared drive that has read/write access to it - so the user can open, modify and save the document as if the file was local. This doesn't happen if the file is retrieved through the webserver (which this isn't - it is linked to from a file on the webserver - the web page) as the file is read by the webserver and not MS Word, and sends the data to the browser. The browser detects that it is MS word and opens MS Word and passes the data streamed from the server.

The way to stop this happening is to present the file through the webserver (not just linking to it). This can be done in a few ways, though will prevent the user from being able to save it back to the original location.. so as long as that is what they want..

1. Create a virtual directory in IIS that maps to the shared drive, ensuring that the webserver account (or user account if this uses windows authentication) can access the share. Then link to it as if the file were under your website root e.g. /myvirtualdir/myfile.doc etc etc

2. Read the file from the filesystem - ensuring correct permissions exist etc and then write the binary data to the response buffer and set the content type to "application/vnd.ms-word" or "application/vnd.ms-excel"

option 1 is easier..

As for it opening up in a different window - this will almost always happen for non-IE browsers. It will happen for IE users when accessing the file through a share name - but IE will usually show it 'inline' if you use option 1 or 2 above.

As for your logfile... I think we'll need more info - not totally sure what your problem is... is it a log file for hits of the requested file ? what does the batch job do ? What do users want from this logfile ? Can you provide a link to the hotfix..?

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Thank you very much for your response.

1.On our web server where the files reside, I selected the view option to not show hidden files and folders. But fso still reads and display it on my directory hierarchy tree.
Funny thing is, on our test server where the option to show hidden files and folders is selected, the ~$edoc.doc
does not show up in the directory list.

2. Can you tell me how and where I can create a virtual directory in IIS that maps to the shared drive? I launched inetmgr, but got lost from there.

3. The logfile is just a text file created and updated by a batch job that runs behind the scene. The batch job does some updates in our Oracle DB and writes to this logfile after it completes a cycle of updates (loop) - in the course of 3 hrs. I would want my user to see the progress of the batch job as it affects their store. The file resides in our web server.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top