Hi,

I am using .Net client library to post image files into my Picasa
photo album.

My codes are very simple as following,
---------------------------------------------------------------------------------------------------------
 string file = FileUpload3.FileName;

 PicasaService service = new PicasaService(servicename);
 service.setUserCredentials( id, pw);

 Uri postUri = new Uri(PicasaQuery.CreatePicasaUri(_user1, _albumid));
 PicasaEntry entry = (PicasaEntry)service.Insert(postUri,
FileUpload3.FileContent, "Image/jpeg", file);
---------------------------------------------------------------------------------------------------------

Most of time, it is working fine.  But if I post a large image file,
which could be 1 or 2 MB, it could post fail and get following error
message,

---------------------------------------------------------------------------------------------------------
The remote server returned an error: (400) Bad Request.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned
an error: (400) Bad Request.

Source Error:

Line 704:                Tracing.TraceCall("calling the real execution
over the webresponse");
Line 705:                LogRequest(this.webRequest);
Line 706:                this.webResponse = this.webRequest.GetResponse
();
Line 707:            }
Line 708:            catch (WebException e)


Source File: C:\Program Files\Google\Google Data API SDK\Sources
\Library\core\request.cs    Line: 706

Stack Trace:

[WebException: The remote server returned an error: (400) Bad
Request.]
   System.Net.HttpWebRequest.GetResponse() +1532114
   Google.GData.Client.GDataRequest.Execute() in C:\Program Files
\Google\Google Data API SDK\Sources\Library\core\request.cs:706

[GDataRequestException: Execution of request failed:
http://picasaweb.google.com/data/feed/api/user/mypicasaid/albumid/xxxxxxxxxxxxxxxxxxxx]
   Google.GData.Client.GDataRequest.Execute() in C:\Program Files
\Google\Google Data API SDK\Sources\Library\core\request.cs:712
   Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
in C:\Program Files\Google\Google Data API SDK\Sources\Library\core
\gauthrequest.cs:753
   Google.GData.Client.GDataGAuthRequest.Execute() in C:\Program Files
\Google\Google Data API SDK\Sources\Library\core\gauthrequest.cs:684
   Google.GData.Client.Service.StreamSend(Uri targetUri, Stream
inputStream, GDataRequestType type, String contentType, String
slugHeader, String etag, AsyncSendData data) in C:\Program Files\Google
\Google Data API SDK\Sources\Library\core\service.cs:994
   Google.GData.Client.Service.StreamSend(Uri targetUri, Stream
inputStream, GDataRequestType type, String contentType, String
slugHeader) in C:\Program Files\Google\Google Data API SDK\Sources
\Library\core\service.cs:885
   Google.GData.Client.Service.Insert(Uri uriTarget, Stream input,
String contentType, String slugHeader) in C:\Program Files\Google
\Google Data API SDK\Sources\Library\core\service.cs:716
   uploadtest.btnUpload3_Click(Object sender, EventArgs e) in d:
\Project\Sample\website_photocontest\uploadtest.aspx.cs:147
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +107
 
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
   System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1746
---------------------------------------------------------------------------------------------------------

Could anybody help me?  Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Picasa-Data-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to