Create file in local user-machine

  • Thread starter Thread starter Bnob
  • Start date Start date
B

Bnob

It is possible to create a file in local user-machine?

With this code in code-behind:

fs = New System.IO.FileStream(lFileCSV, System.IO.FileMode.Create,
System.IO.FileAccess.Write)

The file is created on the server.

Any idea?
 
hi,
The code creates a file on the server since it is getting executed on the
server side. You might have to try and send the file using
response.binaryWrite so that the user can save the file to his machine.
HTH
srini
 
Michael Tkachev a couché sur son écran :
Why do you want to create a file in the client-machine?

The file to create is a csv file

So each user have a different web page, and I'don't want to save this
file in the server.
 
....Or, if this is a controlled environment, and you know that the user's
browser settings will allow it, you can create a client-side FileSystemObject
object with VBScript or JavaScript. Here is a start:

<script language=javascript>
var fso=new ActiveXObject("Scripting.FileSystemObject");
</script>

OR

<script language=vbscript>
Dim fso

Set fso = CreateObject("Scripting.FileSystemObject")
</script>

Good luck.

-Jess
 
Back
Top