I agree with your points regarding security.

I don't need to make the entire download process automatic.  The user
will still get the SaveAs prompt.  I just need to be able to open the
file after it's been downloaded, without the user having to open the
file manually.

The reason for this somewhat impractical process is that the Excel
files that will be downloaded contain macros which only work on the
user’s hard drive.  The macros don’t circumvent Office security.  The
user still has the option to enable/disable macros.

In other words, I’m looking for a way to open an existing Excel file
on the user’s computer from my ASP.net app.  Is this possible?

On Mar 17, 6:46 am, The_Fruitman <[email protected]> wrote:
> Think of the security implications of allowing a web page to execute a
> command to open a specified file on a user's hard drive.  This is why
> you're having issues trying to get that to work, had this been a
> feature that Microsoft included malicious web sites would be even more
> rampant that they already are.  Why are you trying to allow the user
> to click a link and have the link download the file and open it at the
> same time?
>
> There comes a time in software development that developers try to make
> things too user friendly and try to take all thinking away from their
> end users.  When that happens developers overcomplicate the program
> and the result is that end users don't like the application because it
> crashes, has bugs, and/or attempts to out think them (making them feel
> stupid).
>
> On Mar 16, 4:42 pm, OPar <[email protected]> wrote:
>
>
>
> > I am trying to figure out a way to download a file onto the users
> > computer from an ASP.NET webpage and then open that file
> > automatically.
>
> > I'm using the code shown below to download the file.  This also give
> > the option to open the file, but it opens it in the browser -- not the
> > user's hard drive.
>
> > How can I open the file that was download to the user's hard drive?
>
> > Response.ContentType = "application/vnd.ms-excel"
> > Response.ContentType = "application/x-msdownload"
> > Response.AddHeader("Content-Length", fileInfo.Length.ToString)
> > Response.WriteFile(filePath)
> > Response.End()- Hide quoted text -
>
> - Show quoted text -

Reply via email to