navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

hyperlink to text file problem

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> hyperlink to text file problem
Page: [1]
 
dprice_2000

 

Posts: 4
Joined: 4/18/2008
Status: offline

 
hyperlink to text file problem - 4/18/2008 9:01:32   
Hi All,

I'm having problems with a hyperlink to a text file.
Here is the low-down...

A user selects a file from their drive and runs a process to parse and insert records into a database. This process can be repeated for any number of files.

During the process, if any errors are found, an error file is created and the offending record(s) are written to it. This file is used for all imports and is always deleted prior to importing. A hyperlink on the page points to the error file so the user can view the errors in notepad, correct them, save the file and reimport them.

The problem is that clicking on the link always brings up the first instance of the error file. "error[1].log"
It's as if it's being cached somewhere. It works on my local pc where I am developing from but not on the server where it lives.

Any ideas?

VS.NET

Thanks,
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 9:16:10   
Hi and Welcome to OutFront.

You say VS.NET? Local application or is it a Web App?

How are you creating the text file? Is it being created by the app each time?

Have you tried .NET no cache header like this?

<% System.Web.HttpContext.Current.Response.AddHeader( "Cache-Control","no-cache")
System.Web.HttpContext.Current.Response.Expires = 0
System.Web.HttpContext.Current.Response.Cache.SetN oStore()
System.Web.HttpContext.Current.Response.AddHeader( "Pragma", "no-cache")%>


That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dprice_2000)
dprice_2000

 

Posts: 4
Joined: 4/18/2008
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 9:54:41   
Hi Mr. Douglass,

Yes, I'm developing using VS.NET 2005.
I develop it locally and then copy it up to the server.
It works fine on my pc but not on the server
I'm using a streamwriter to append the error record during the import.
I delete the error file prior to every import.

The lines you provided didn't have any affect.

thanks,
Dave

(in reply to rdouglass)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 10:09:43   
quote:

I'm using a streamwriter to append the error record during the import.


So you delete it first and then recreate it? Or you append to the existing file?

That is a weird one. Do you always get the same file or is it always from the previous upload or error? IOW is it the same file every time? Does hitting refresh or clearing the local browser cache make any diff?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dprice_2000)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 10:10:37   
quote:

Mr. Douglass,


Oh yeah, that's my father. :)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dprice_2000)
dprice_2000

 

Posts: 4
Joined: 4/18/2008
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 11:26:36   
Yes, I delete it and recreate it for each import.
As I process the import file I append the errors to the same file.

Yes it's weird. I've not run into this before.
I retested it. It's always the first one no matter how many imports I do.
Hitting refresh has no effect.

Deleting temporary files through the options menu does cause the correct file to show up!
From my reading I understand this is not easily done in code if not impossible.

thanks,
Dave

(in reply to rdouglass)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 12:03:43   
So the link is directly to the text file?

If so, how about reading the text file into a stream on an ASPX page instead and then pushing it as a download file instead of a direct link to the text file. Then you're taking the user's browser preference right out of the picture by using the no-cache stuff.

Did that make any sense?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to dprice_2000)
dprice_2000

 

Posts: 4
Joined: 4/18/2008
Status: offline

 
RE: hyperlink to text file problem - 4/18/2008 12:21:21   
That works for me. Thanks!

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> General Web Development >> hyperlink to text file problem
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts