filestream and security

Slurpee

Member
Joined
Apr 19, 2003
Messages
15
Ive run into a bit of a problem :( Im trying to download selected files from an arbitrary web page. The image files are to be written to a directory.

private local as string = "./images"
Dim FileStreamer As New FileStream(local, FileMode.Create)

now I have tryed this but Im getting a error indicatiing that I dont have permission? This is wierd as if I pass in a location to my method the code works fine. Anyone got some advice or a nice reference site?
 
Heres a function that works for me..

Code:
    Private Sub GetImage(ByVal sDir As String, ByVal sName As String)
        Try
            Dim wc As New Net.WebClient()
            wc.DownloadFile(URL_IMAGE & sDir & "/" & sName, sName)
            wc.Dispose()
            Image1.Image = Image.FromFile(s)display it in an image box
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try
    End Sub
URL_IMAGE is the web server location
sDir is the directory its in
sName the name of the pic
 
cheers Ill try and use that code if I can :) I do have one other question though that someone may be able to answer:

Reqest = HttpWebRequest.Create(sURL & Filename & Prefix)

if I want to use the above code...where sURL is a URI is there a way to add the filename and prexif to the URI. Sorry if it a basic question but this is day two of web stuff :(


Thanx
 
Back
Top