Thank you Austin!
Can you try this for me?
google.gears.factory.getPermission();
function selectFiles()
{
var desktop = google.gears.factory.create('beta.desktop');
desktop.openFiles(openFilesCallback);
}
function openFilesCallback(files)
{
for(var i=0;i<files.length;i++)
{
upload(files[i]);
}
}
function upload(file)
{
var offset_request =
google.gears.factory.create('beta.httprequest');
offset_request.open('GET', 'http://achau.appspot.com/' );
offset_request.onreadystatechange = function()
{
if(offset_request.readyState ==4)
{
upload_request.open('PUT', 'http://achau.appspot.com/' );
upload_request.onreadystatechange = function()
{
if(upload_request.readyState ==4)
{
alert(upload_request.responseText)
}
};
upload_request.send( file.blob );
}
}
}
offset_request.send();
}
On Oct 21, 8:19 am, Austin Chau <[EMAIL PROTECTED]> wrote:
> Hi,
>
> To try to reproduce this, I create a simple PUT request handler from
> my appengine host that would accept a PUT request tohttp://achau.appengine.com
> and it would return "PUT REQUEST SUCCESS".
>
> And I am using this sample
> scripthttp://achau.appspot.com/static/gears/httprequest.html
> to use HttpRequest to send the PUT request to it. I have tried this
> on my machine using Firefox 3 and IE8 and they both seems to be
> working fine. I am running with Gears version 0.4.24.0. Would you
> mind hitting the same URL to see if you still have that problem ?
>
> http://achau.appspot.com/static/gears/httprequest.html
>
> Austin
>
> On Oct 19, 8:20 pm, est <[EMAIL PROTECTED]> wrote:
>
>
>
> > function upload(file)
> > {
> > var offset_request =
> > google.gears.factory.create('beta.httprequest');
> > offset_request.open('GET', '/offset/' + window.currentSlug);
> > offset_request.onreadystatechange = function()
> > {
> > if(offset_request.readyState ==4)
> > {
> > var upload_request =
> > google.gears.factory.create('beta.httprequest');
> > upload_request.open('PUT', '/append/'+
> > window.currentSlug);
> > upload_request.upload.onprogress = function(progressEvent)
> > {
> > percentage = (progressEvent.loaded /
> > progressEvent.total * 100).toString()
> > document.getElementById('divBar').style['width'] =
> > percentage + '%';
> > };
> > upload_request.onreadystatechange = function()
> > {
> > if(upload_request.readyState ==4)
> > {
> > alert('Upload done. MD5:\n' +
> > upload_request.responseText)
>
> > }
> > };
>
> > upload_request.send( file.blob.slice(offset,
> > file.blob.length-offset) );
> > }
> > }
> > }
> > offset_request.send();
>
> > }
>
> > when testing this under IE6/7/8 using Google Gears 0.4.20.0, it
> > prompts a 'Internal Error' on this line
>
> > upload_request.open('PUT', '/append/'+ window.currentSlug);
>
> > But when change 'PUT' to 'POST' it'll be OK
>
> > Is 'PUT' not working under IE?- Hide quoted text -
>
> - Show quoted text -