Downloading and uploading a file (javascript app)

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Downloading and uploading a file (javascript app)

Postby rozenman » Tue Mar 31, 2015 5:22 am

Hey guys,
I am new to CEF3. I am building a javascript app using CEF3. In my app, the user can create data, which I want to be able to save into a file (json format, text file). Also, I want him/her to be able to upload a file previously created. As there is no way to save or upload a file using javascript, I want to do the usual 'loop' of sending the content to the 'server' (in our case, a new scheme - lets call it 'data://'), and from there to send it back to the javascript code (if uploading) or to the user computer (downloading). I do not know how to do it, and wish you guys can explain it or post a link to a good example/guide for that :)
Also, if you know of a better way to do this, without doing this unneeded loop - would be even better (would rather not to use Flash)!

Thanks!
rozenman
Techie
 
Posts: 16
Joined: Sun Mar 01, 2015 10:02 am

Re: Downloading and uploading a file (javascript app)

Postby magreenblatt » Tue Mar 31, 2015 6:15 am

Usage of custom request handling is described in https://bitbucket.org/chromiumembedded/ ... t-handling
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Downloading and uploading a file (javascript app)

Postby rozenman » Tue Mar 31, 2015 9:08 am

magreenblatt wrote:Usage of custom request handling is described in https://bitbucket.org/chromiumembedded/ ... t-handling

Thanks for reply!
I don't know how to send a file or upload a file inside the handler.. Is there any example/guide for that?

Thanks!
rozenman
Techie
 
Posts: 16
Joined: Sun Mar 01, 2015 10:02 am

Re: Downloading and uploading a file (javascript app)

Postby magreenblatt » Tue Mar 31, 2015 9:15 am

rozenman wrote:I don't know how to send a file or upload a file inside the handler.. Is there any example/guide for that?

It's the same as uploading to a server, except you handle the request/response in your application via CefResourceHandler.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Downloading and uploading a file (javascript app)

Postby rozenman » Mon Apr 06, 2015 2:39 am

magreenblatt wrote:
rozenman wrote:I don't know how to send a file or upload a file inside the handler.. Is there any example/guide for that?

It's the same as uploading to a server, except you handle the request/response in your application via CefResourceHandler.


Hey,
I am really having trouble doing this.. I am new to CEF and c++. I just want to send back the uploaded file when uploading, and send a file (from a given path) when downloading.
I couldn't find any examples, though it is something many use (I guess).
Can anyone help me with this? :roll:
rozenman
Techie
 
Posts: 16
Joined: Sun Mar 01, 2015 10:02 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 76 guests