Image Upload Problems : Could not find file

Topics: User Forum
Nov 28, 2006 at 9:58 AM
I am having trouble getting the image upload to work. The problem I am having is not related directly to FlickrNet as far as I am aware but hopefully someone on here can offer me some assistance. I am using the Metabuilders FileUpload control ( and this is the code to handle the selected file:

Flickr flickr = new Flickr();
flickr.UploadPicture(FileUpload.PostedFile.FileName, string.Empty, string.Empty, GetSelectedTags(), false, false, false);
Result.Text = "File '" + filePath + "' Saved";

On my local machine this works fine, however on the remote server the file appears to upload and then fails with the message "Could not find file", when I know for a fact that the file does exist in that exact location and can confirm this by copying the file path into an explorer window.

Any help would be very much appreciated.

Nov 28, 2006 at 10:53 AM
PostedFile.FileName is the fully qualified filename on the client - you need to access the file on the server.

use the PostedFile.InputStream instead.
Jul 8, 2010 at 9:12 PM

I've seen this question worded 10 different ways, with the same answer... "Use the InputStream". Can somebody PLEASE give an example of using the input stream?

Jul 9, 2010 at 6:54 AM

The UploadPicture method takes a Stream as the first parameter, so the above method would be changed to the following:

flickr.UploadPicture(FileUpload.PostedFile.InputStream, "Test.jpg", "", "", "", false, false, false);


Jul 12, 2010 at 1:58 AM

I solved this with the following code, because it seemed like the flickr.UploadPicture function required 11 arguments when using the FileUpload.PostedFile.InputStream

flickr.UploadPicture(FileUpload.PostedFile.InputStream, FileUpload.FileName, "title", "", "", false, false, false, FlickrNet.ContentType.Photo, 0, 0);