Dear friend,
As you know that ASP .NET has client side and server side...
it means that we can get and open a file from client (C:\jaguar.jpg) then get the byte of array, then we save it to the server (Server.MapPath(Request.ApplicationPath) & "\Images\HORE.jpg")...
i tried the following code, but it does not work properly when we open the file from client...
Pls help...
Thank you,
hendy
=======source code ===============
Dim s As Stream = File.OpenRead("C:\jaguar.jpg")
Dim buffer(s.Length) As Byte
s.Read(buffer, 0, CType(s.Length, Integer))
Dim len As Integer = CType(s.Length, Integer)
s.Close()
Dim fs As FileStream = New FileStream(Server.MapPath(Request.ApplicationPath) & "\Images\HORE.jpg", FileMode.Create)
fs.Write(buffer, 0, len)
fs.Close()
Loading
JohnPosted Apr 7, 2007, 10:23 PM
For client-side code, you need to write it is javascript or some other client side code. However, keep in mind that it is usually a security violation to access the client's file system from the browser. Why don't you just have the client upload the file to the server, then run your code server-side?
Let me know if you need more help...