ASP.Net Newbie Question: Upload Files

  • Thread starter Thread starter Johnny Meredith
  • Start date Start date
J

Johnny Meredith

Newbie to Visual Web Designer (ASP.net 2.0 b2)

I'm completely rewriting an Access application we use to track the
progress of Tax Audits. Part of the functionality provided was a means
to attach files (Excel, Word, PDFs, etc.) to the database by making a
copy of the file provided by the user, storing this copy in an
attachments directory, and storing the path in the database. The user
can click on the files (shown in a listbox) and the file would execute
and be displayed in their native applications.

I want the same functionality in the new app. It would be very helpful
if I could show a "preview" of the file contents in a control (if
possible), and also give the user the option to download/run the file.

Can anyone point me in the right direction? Has all/some of this type
of functionality already provided out-of-the-box?

Thanks,
Johnny
 
Hi,

< show a "preview" of the file contents in a control

In order to show a preview of a document within your application you would probably require some OLE and COM development. There is
no support as of .NET 1.1 for this, although you can use the "Web Browser" control to act as an OLE container for Office docs or to
display text, xml, images, etc. As for a preview, I do not have a reasonable solution for you.

< give the user the option to download/run the file.

For a windows application: Starting a new process, using the name of the document as the name of the process, will open the
document in its assigned application. See System.Diagnostics.Process.

In an internet application, you have two options:

1. Save the file to disk and use anchors in your pages to point to the file on the web server.

2. Create a web page that can use Get or Post data to extract a file name that is being requested, retrieve it from the database and
write it to the Response stream. In this case, you should probably store the MIME format of the document in the database, along
with the data so the browser knows what to expect.

Hope it helps ;)
 
Back
Top