"File not found" is not a server error message. It's an indication that the
media file is not found on your local machine.

On Sun, Mar 14, 2010 at 8:56 AM, anushree <[email protected]>wrote:

> well i tried uploading a photo into an album and the code is returning
> a file not found exception!!
> i am pasting the code here can anyone please tell me whats going wrong
> here?
>
> private void uploadPhoto(String auth,String albumid)
> {
> try
> {
>        String s = "http://picasaweb.google.com/data/feed/api/user/userid/
> albumid/<http://picasaweb.google.com/data/feed/api/user/userid/%0Aalbumid/>
> "+albumid;
>        URL url = new URL(s);
>        HttpURLConnection httpConnection = (HttpURLConnection)
> url.openConnection();
>        httpConnection.setRequestProperty(
>                        AUTH_HEADER_KEY,
> String.format(AUTH_HEADER_VALUE_TEMPLATE, auth));
>        httpConnection.setRequestProperty(
>                        GDATA_VERSION_HEADER_KEY,
> GDATA_VERSION_HEADER_VALUE);
>        httpConnection.setRequestProperty(
>                        CONTENT_TYPE_HEADER_KEY,
> IMAGE_CONTENT_TYPE_HEADER_VALUE);
>        httpConnection.setRequestProperty(
>                        CONTENT_LENGTH_HEADER_KEY,
> CONTENT_LENGTH_HEADER_VALUE);
>        //httpConnection.setRequestProperty(
>                        //USER_AGENT_HEADER_KEY, USER_AGENT_HEADER_VALUE);
>        //httpConnection.setRequestProperty(
>                //      MIME_VERSION_HEADER_KEY, MIME_VERSION_HEADER_VALUE);
>        httpConnection.setRequestProperty(
>                        SLUG, SLUG_VALUE);
>        httpConnection.setDoOutput(true);
>        httpConnection.setRequestMethod("POST");
>        DataOutputStream dataOutput = new
> DataOutputStream(httpConnection.getOutputStream());
>        DataInputStream  dis = new DataInputStream(new FileInputStream("C://
> Documents and Settings/Admin/My Documents/garfield_1.jpg"));
>        int read = 0;
>        //System.out.println("Attempting to write on buffer");
>        while((read = dis.read())!=-1 ){
>                dataOutput.write(read);
>        }
>        //System.out.println("Buffer write completed!!");
>        dataOutput.flush();
>        int responseCode = httpConnection.getResponseCode();
>        System.out.println(responseCode);
>        dis.close();
>        dataOutput.close();
> }catch(Exception e){e.printStackTrace();}
>
> }
>
> --
> 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]<google-picasa-data-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-picasa-data-api?hl=en.
>
>

-- 
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