Hi, I use this code for upload a csv file and convert it.
//1) Get input stream from a blobstore file and the blobinfo metas
final BlobInfo blobInfo = new BlobInfoFactory().loadBlobInfo(blobKey);
BlobstoreInputStream blobStoreReader = null;
try {
blobStoreReader = new BlobstoreInputStream(blobKey);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//2) create a new document list entry
DocumentListEntry newDocument = new DocumentListEntry();
// 3) set the inputstream as a source for the new document entry
newDocument.setMediaSource(new MediaStreamSource(blobStoreReader,
blobInfo.getContentType()));
newDocument.setTitle(new PlainTextConstruct(
blobInfo.getFilename()));
// 4) upload - feedUrl >
https://docs.google.com/feeds/[email protected]/private/full?convert=false
DocsService client = new DocsService("BlobStore2Docs");
client.insert(feedUrl, newDocument);
Excuse for the spaghetti code ^^
I hope this useful for you.
Cheers
PS: If you are interested I've developed a "BlobStore2Docs.java" that
resolve the problem. If you want contact me for any reason.
On Mon, Jan 9, 2012 at 5:21 PM, newdeveloper <
[email protected]> wrote:
> I'm very new to GAE. Could you anyone kindly show me how to upload a
> PDF file from blobstore to google docs in Java? Thanks.
>
> On Jan 7, 6:00 am, Ernesto Oltra <[email protected]> wrote:
> > Hi,
> >
> > I've just finished today implementing a resumable uploader in my app,
> from
> > blobstore to google docs. It's possible, it works and it's the best way.
> If
> > you found it easier you can upload all the file at once with resumable
> > upload too, but any little problem will make the entire upload fail (and
> > not a little chunk).
> >
> > Ernesto
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" 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-appengine?hl=en.
>
>
--
Alessandro Aglietti
webLog <http://blog.aqquadro.it> -
realtimeCV<http://cv.alessandroaglietti.com> -
Google+ <https://alessandroaglietti.com>
*
*
*"Gli'รจ ora d'illuminassi, tirassi sui i calzoni e levassi"*
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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-appengine?hl=en.