Save To Drive Button Doesn't Work -
i wrote simple file server in nodejs serve html page save drive button. html page served @ my_address:1337
, file saved served @ my_address:1338
. upon clicking save drive button, shows "starting download" long time displays failed download. xhr error
.
i thought due fact file being served different port decided same appengine app. page served @ http://sayodrive.appspot.com/index.html , file served @ http://sayodrive.appspot.com/drivefile.jsp, got same problem.
then decided local java web application: same problem. tried changing content disposition attachment
(to force download) didn't work either.
frustrated, started googling , came across this page claims save drive button doesn't work. went official google drive sdk page , discovered example button doesn't work too. is bad dream?
source: index.html
<html> <head> <title>test: save drive</title> <!-- --> <link rel="canonical" href="http://sayodrive.appspot.com"> <script src="https://apis.google.com/js/plusone.js"></script> </head> <body> <p>this must worst html have ever seen :)</p> <div class="g-savetodrive" data-src="//http://sayodrive.appspot.com/drivefile.jsp" data-filename="test drive" data-sitename="sayo saves"> </div> </body> </html>
source: drivefile.jsp
<%@ page language="java" contenttype="text/html; charset=utf-8" pageencoding="utf-8"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>drivefile</title> </head> <body> <% java.io.writer w = response.getwriter(); response.setcontenttype("text/plain"); w.write("if you're reading in drive, congrats!"); w.flush(); w.close(); %> </body> </html>
the original sample not working because cache-control
header not being exposed server. fixed.
access-control-expose-headers: cache-control, content-encoding, content-range
more in documentation.
Comments
Post a Comment