473,394 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Viewing/Opening files from SQL DB

Howdy!

I have a windows app where you can add attachments to memos. These
attachments can be anything (word, excel, pdf, etc). One form in my
app lists the names of the attachments in a List and the user can
select one to view. My code right now takes the attachment, puts it
into a new file stream to the path C:\Temp, writes the file to that
directory, and then opens that file using a Process.Start.

Everything works great, but I'm sure there is a better way to do this
so that a copy of the file doesn't need to be written to the user's PC
- or to at least delete it after they are done viewing it? Does anyone
have an example? Here is a code snippett of what I am currently using:

--------------
myStream = New System.IO.FileStream(DestFilePath, IO.FileMode.Create,
IO.FileAccess.ReadWrite)

myStream.Write(attachment, 0, attachment.Length)
myStream.Close()
Process.Start("File:\\" & DestFilePath)
--------------

Thanks a bunch!
Michelle

Nov 21 '05 #1
0 916

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: yogesh | last post by:
How to store the java applet emebedded in a web page for offline viewing? I saved the web page but it got saved without the applet.and also I searched for the corressponding .class file for the...
4
by: CW | last post by:
I just took an extensive ASP.NET course and copied my projects to my wwwroot folder and tried opening my default page which consumes some web service. It worked ok at the course but now I get this...
1
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0....
10
by: Edlueze | last post by:
I am developing some Data Access Pages (DAP) using Microsoft Access 2003 on Microsoft Windows XP. When I try to open these pages (located on my C: drive), the display of the data access page is...
2
by: Matthias H. | last post by:
Hi guys, Our team has a very strange problem. I hope anybody can help. We have a class called webpage and all our aspx-pages bases on it. Then we have a SYS.IO.File Class which have a...
1
by: Gary | last post by:
Is it possible to have a "floating" area designated to show an enlarged image of a thumbnail? Right now I'm using a script to enlarge the image, where it's at, onmouseover, but when it enlarges,...
13
by: Toby Newman | last post by:
I started learning XML on Monday. I have an XML file and have written an XSL file to render it to HTML for formatted viewing in a browser. I'd like to create a second alternative view of the...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
1
by: blesstomz | last post by:
hi..all how can i block viewing the datas in a text boxes while opening a form in ms access.now when i open the form scrolling ma mouse all the datas i entered before are displaying in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.