Uploading Photos

Topics: Developer Forum, User Forum
Dec 17, 2009 at 1:11 PM

Anytime I try and upload a photo when the code is uploaded to my server I get this message:

Could not find file 'c:\windows\system32\inetsrv\abstractArtBlueSparkles.jpg'.

Line 43:             Dim photo As String = f.UploadPicture(file, title, description)

My full code is this:

        Dim f As New FlickrNet.Flickr()

        Dim file As String

        If btnUpload.HasFile Then
            file = btnUpload.FileName

            Dim title As String = "Test"
            Dim description As String = "Test Photo"

            Dim photo As String = f.UploadPicture(file, title, description)
            PhotoRepeater.DataSource = RecentPhotos()
        End If

I have no problems uploading the photo on my desktop but when I move the code to the server I get the above error message.



Dec 18, 2009 at 7:37 AM

FileUpload.FileName only contains the name of the file on the client, not the full path of the file once uploaded to the server.

You can use the FileUpload.PostedFile.InputStream property to access the stream to upload it to Flickr, or some other method perhaps.


Dec 18, 2009 at 12:17 PM

Do the photos have to be on the web server before i can upload them?

I am trying to upload the photos from my c:\ drive on my local computer

I am saving the photo into a directory on my web server before I try and upload them to Flickr.


And I have tried this "FileUpload.PostedFile.FileName" which includes the entire path but it is still looking for the photo in this directory


instead of c:\documents and settings\user\my pictures\abstractArtBlueSparkles.jpg

Dec 18, 2009 at 12:25 PM

You cannot refer to the file by its client filename - you are on the server - The C:\ drive is your servers C drive, not the clients C drive.

Use the InputStream I referred to above.

Dec 18, 2009 at 12:35 PM

Ok I just used the location of the file that is saved on the server and all went fine.

Thanks for the help