Create directory and create file

Hi,

i've developed and asp.net application using vb.net that enables the user to store multiple files of any type to SQL 2000 database. Now ive used the code below to allow the user to download or retrieve the file from the database back to local file system:
Dim strFilePath As String = "c:\temp"
Dim strFileName As String = "xxx.pdf"
myByteStorage = CType(myDataRow("DocBody"), Byte())
myOutput = File.Create(strFilePath & "\" & strFileName & "_new", myByteStorage.Length)
myOutput.Write(myByteStorage, 0, myByteStorage.Length)
myOutput.Close()
During testing it seems to work fine given that the server and client is on the same machine. But once i tested it on a different machine the file is not saved on the client machine.
Is there a work around this problem? Code snippets will be really helpful. Thank you so much.

0
saphju
7/8/2004 4:48:07 PM
asp.net.client-side 24353 articles. 2 followers. Follow

1 Replies
977 Views

Similar Articles

[PageSpeed] 45
Get it on Google Play
Get it on Apple App Store

put this in page load of your download.aspx page

code snippet
MyFileStream = New FileStream(Server.MapPath("./tmp/" & dbo._ol_name), FileMode.Open)
FileHandle = MyFileStream.Handle
FileSize = MyFileStream.Length
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + dbo._ol_name)
Response.AddHeader("Content-Length", FileSize)
Response.ContentType = "application/octet-stream"
Response.WriteFile(FileHandle, StartPos, FileSize)
Response.Flush()
MyFileStream.Close()
If File.Exists(Server.MapPath("./tmp/" & dbo._ol_name)) Then
File.Delete(Server.MapPath("./tmp/" & dbo._ol_name))
End If
Jean-Francois Borie
"Jef"
0
jef06
7/8/2004 8:43:36 PM
Reply:

Similar Artilces:

create directory on client side
 hi All ,i m using ASP .NET 2.0 . i have number of images as soon as click download button , create directory on client side and images should be download in that perticular directory. is it possible using javascript ? or any other technique .Thanks in advance..........  ; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:...

creating a thumbnail image of a client side file
With the help of a number of very useful posts, as well as some great how to videos, I have coded a multi image ajax-like upload page. It is a mashup of this: http://www.asp.net/learn/videos/video-253.aspx and this: http://www.asp.net/learn/videos/video-254.aspx So my question. When an image file is selected by the client on the client side for upload using the file upload object, is it possible to create a thumbnail image of the larger image and stick it on the page without a post back.  This would allow the user to remember which files were selected for upload i...

Getting this error: BC30138: Unable to create temp file in path 'C:\DOCUME~1\CLIENT\ASPNET\LOCALS~1\Temp\': The file or directory is corrupted and unreadable.
Hay everyone, I am getting this error whever try to debug my ASP.NET application. Actually, before this error i was working on ASP.NET and due to light fluctuation my system restarted. When again I tried to debug my application, it gave me this error: Compiler Error Message: BC30138: Unable to create temp file in path 'C:\DOCUME~1\CLIENT\ASPNET\LOCALS~1\Temp\': The file or directory is corrupted and unreadable. Can anyone help me to resolve this problem.Looking for urgent reply,TAM Looks like the file is corupted.You need to simply delete the file from the path that is in My Documents...

how to create page for creating active directory account and integrate in create user page
hi all...am bit new to this share point server. can someone please tell me how to create a page for creting an activie directory account for sharepoint server ie.s sps 3.0.. i ve installed sharepoint service 3.0 on my server for for creatign users i need to do it manually get into the server and create user. but in sme other site its is given a seperate page for creating user and sending invitaion to user to user the site.. and the pass and userid and others ll be sent automatically to their id..i need to like tat .. can you plz help me...thnkx----Jai---------http://www.jayaraja.comh...

Sending Dynamically Created .vdx/.vsd File To Client Side
Hello, I am creating a .vdx file dynamically on web server based on user input. I would like to send that file to client directly and want to delete that file from server. Is this possible? I tried using filestream and memorystream objects but I am unable to find the solution. Currently I am send this directly by using Response.redirect(fileName). Is there any better way to solve my problem? Is so please suggest me. If this is possible with fileStream/Memorystream objects then how can I make it work. Thanks in Advance,Vensip. Response.TransmitFile("path of your file"); OR Respon...

How to create client side "Save as CSV file" button?
I am able to retrieve data and display it in a browser. How do I create a button that will allow the data to be saved as a CSV file on the client side? Simple. Procedure: 1- Write out the file on the server. 2- Redirect the user to the file . ( using: print ("Location: http://..URL..TO..FILE") ) 3- Remove the file from the server. ----- Original Message ----- From: "chris" <chris@home.com> To: <beginners-cgi@perl.org> Sent: Wednesday, September 25, 2002 4:43 AM Subject: How to create client side "Save as CSV file" button? > ...

I create the file like this System.IO.File.Create("pallingtest1.txt") but how do I tell it where to save the file?
can anyone help? Why don't you specify the fully qualified path where you want to write the file rather than try and figure out where its going to write it? Jeev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~If you get the answer to your question, please mark it as the answer.  From the MSDN docs: <i>The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.</i>http://msdn2.microsoft.com/en-us...

File created by javascript is created at root level iso at map level of creating webpage
Name: Frans Janssens Email: fransdotjanssensatcollemboladotorg Product: Firefox Summary: File created by javascript is created at root level iso at map level of creating webpage Comments: At www.collembola.org Click on Search this site Enter tamura and start search In the poppedup list click on any link. It will not work. This works in IE and worked in Firefox 2.0.0.14 What happens is this. The search will create a file by javascript in which the user can select a link. This file is since version 3.0.1 created at root level iso at the level of the page that created the ...

How to create an activex object that can write a value to a file in the client side for a intranet site?
How to create an activex object that can write a value to a file in the client side for a intranet site? Here's some basic guidance on developing ActiveX controls: http://msdn2.microsoft.com/en-us/library/aa752037(VS.85).aspx Regards Mike [MVP - ASP/ASP.NET]My site I would suggest against writing an Active X control, as the user or their admin may not allow it to be installed.  What you can consider though is creating or writing a value to a file on the server and allowing the user to download it instead.  Rachel AppelMVP - ASPInsider RJA:I would suggest against wr...

Create File function creating problems
I am using C++Builder XE3, in a Windows 7 OS. I am re-using an old piece of code I had that opens a COM port, which contains a Create file function. I included in my *.h file #include <windows.h>, which I read must be included to support WinBase.h on Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista. When I compile the code, it generates the following errors: [bcc32 Error] SerialComm.cpp(36): E2034 Cannot convert 'char *' to 'const wchar_t *' [bcc32 Error] SerialComm.cpp(36): E2342 Type mismatch in parameter 'lpFileName' (wanted &#...

Read a dynamically created html file and re-write it into a newly created file
I need to read a dynamically created html file and save the contents to a new file in a directory. The point is, I have an application that takes imput from the user, they upload files into my database.  I then display a dynamically created page with the files that they have uploaded grouped by week.  I have the preview of their file showing, I cannot figure out how to get that file to save without using the menu's save button.  This option doesn't work becuase I have to save the file, not the user.  Any ideas would be appreciated.   Thank you, I do no...

Create a file in a directory
I have  acode that creates a directory file "named" after the users ID i.e if they are userID 1, the file is called "1". But I want my "NO_IMAGE.gif" image to automatically get copied into the folder once it is created. Is there a way of doing this? Ive been look around on google and randomly attempting to work this out using intellisense. I can copy the file, but I dont know how to paste it into the file. At least I think it copies. lol. File NOIMAGE = File.Copy(@"~\NO_IMAGE.jpg"); but as it doesnt paste im not sure. Does anyone know how to ...

How to Create .mdb file from Excel file using C#.net
Hi all I want to create .mdb file that i have created excel feel from MS jet Database... through code behind Help me in this..  Regards RaviPlease click "mark as answer" if this post helped you. How to create an mdb file programmtically:http://support.microsoft.com/kb/317881How to import Excel data into it: http://www.mikesdotnetting.com/Article.aspx?ArticleID=79 Regards Mike [MVP - ASP/ASP.NET]My site...

Creating .NET Code to read a .his file (like a .txt file)
Hello all! I'd like to read data from a temperature control program that posts data to a .his file.  Sample entries are pasted below: "","",RT3-RH%,RT3-HUSP,RT3-ZNT,RT3-RAT1,12/4/06 4:10:52 PM,13.12,45.00,64.44,65.882,12/4/06 4:15:52 PM,13.13,45.00,64.44,65.813,12/4/06 4:20:52 PM,13.08,45.00,64.44,65.754,12/4/06 4:25:52 PM,13.13,45.00,64.44,65.695,12/4/06 4:30:52 PM,13.11,45.00,64.44,65.696,12/4/06 4:35:52 PM,13.09,45.00,64.44,65.637,12/4/06 4:40:52 PM,13.27,45.00,64.44,65.568,12/4/06 4:45:52 PM,13.32,45.00,64.44,65.75  I'd like to skip the first line...

Web resources about - Create directory and create file - asp.net.client-side

Wikipedia:Quick directory - Wikipedia, the free encyclopedia
This page is a handy directory to various locations of interest in Wikipedia. Only dynamic pages should be listed here, no policy pages etc. ...

Wikipedia:WikiProject Council/Directory - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Business Directory Listings: Eight Smart Tips for You to Get Started
If you are considering a business directory listing for your small business, congratulations – you are on the right track. Local SEO, local customers, ...

LinkedIn Lookup iOS app aims to replace your company’s awful intranet employee directory
... continue reading at 9to5Mac . What do you think? Discuss "LinkedIn Lookup iOS app aims to replace your company’s awful intranet employee directory" ...

Atlas Partner Directory Launched
... just for Facebook and Instagram –advertising platform Atlas has one, as well. On that note, Atlas Tuesday introduced the Atlas Partner Directory ...

Slack announces App Directory store
... create more apps for the store, and a new framework called Botkit which should simplify the process of creating apps. The Slack App Directory, ...

The British Library’s ‘Save Our Sounds’ Program Creates Directory of UK Sound Collections
The long-feared deterioration of the world's sound collections is a coming to a head with the British Library's last-ditch initiative called ...

Researchers show how to steal Windows Active Directory credentials from the Internet
... showed at the Black Hat security conference. The attack, called an SMB relay, causes a Windows computer that's part of an Active Directory ...

Researchers find way to steal Windows Active Directory credentials from the Internet
The technique could enable attackers to attack Windows servers hosted in the cloud

Slack's App Directory proves it's more than just a chatroom
... are about to get a little easier to find and integrate within your team and over 160 of them live within the company's new Slack App Directory. ...

Resources last updated: 12/18/2015 1:18:06 AM