It is currently Tue Jun 18, 2013 1:20 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: downloadaszip
PostPosted: Sun Dec 04, 2011 10:30 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

I have never used a delay when downloading as zip. I simply wait until the status is good, and then begin download of zip file.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 12:11 pm 
Super Tonidoid
Super Tonidoid
Joined: Wed Oct 20, 2010 1:39 pm
Posts: 33

Something is clearly amiss - likely my understanding...

initial request response:
Code:
httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 116
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:25:37 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>startzip</type>
    <result>1</result>
    <message>135424023379842620</message>
  </command>
</commands>


later, zipstatus response:
Code:
httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 328
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:27:26 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>zipstatus</type>
    <result>1</result>
    <message>blah, blah, blah</message>
  </command>
</commands>


elapsed: 01:49

then, after extracting the downloaded zip, repeat:

Code:
httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 116
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:36:28 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>startzip</type>
    <result>1</result>
    <message>135424029885699910</message>
  </command>
</commands>


zipstatus response:

Code:
httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 99
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:37:04 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>zipstatus</type>
    <result>1</result>
    <message/>
  </command>
</commands>


elapsed: 0:36

downloadaszip fails because zip is still in progress, and Tonido_Zip_<id>.zip file left in the directory.

I'm not sure how ladybug helps, though I did use Charles to view the browser's api calls...

Am I perhaps, missing some RequestHeader?

Regards,


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 12:36 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7397
Location: Dallas, USA

The Tonido_zip will remain in the directory for a while.
The download as zip actually downloads that zip file.


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 1:18 pm 
Super Tonidoid
Super Tonidoid
Joined: Wed Oct 20, 2010 1:39 pm
Posts: 33

yes, but why am I getting a result=1 when the zip is NOT ready?

seems like the response is cached somewhere...

Regards,


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 1:49 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

Are you calculating and sending the time parameter when you startzip and request the status? I saw quirky things occur when I did not send the time parameter.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 2:19 pm 
Super Tonidoid
Super Tonidoid
Joined: Wed Oct 20, 2010 1:39 pm
Posts: 33

No, not sending the time... I noticed it on all the calls, but it is not documented in any API docs, so omitted it... how is it calculated.

I don't think the local cache is a problem, since I tried explicitly turning it off in the request (and anyway, its not the same request...)

Also, since I am still running Jaunty, the clock on the plug is messed up. I did create a cron job to reset it every 12 hours or so...

Regards,


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 3:09 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

The time is basically just epoch time in seconds at the time you are making the call.

All the APIs that I currently use are the ones I learned from snooping and listening to the the commands sent through the browsers. I have mimicked them exactly because I assumed there must be a reason for how they were being sent.

I have documented the current ones I have snooped out save getting the image thumbnail (I have it written somewhere, but have not formerly documented it thumbnail images yet because I have not yet used it in my apps; therefore, I am not certain if there are other considerations that need to taken into account with real world usage). There aren't many listed because I don't use a lot of them currently.

http://tonidouser.com/doku.php?id=phpde ... le_for_php

I personally only use the API right now for things like downloading and uploading. Things like getting file lists from the API always filters out things I want to see, so I just use PHP to get that kind of stuff.

Specifically, I have documented downloading as a zip in two sections: "Zip Files in a Folder" and "Download a Folder".

Zipping:
http://tonidouser.com/doku.php?id=phpde ... n_a_folder

Download Zip:
http://tonidouser.com/doku.php?id=phpde ... d_a_folder

Parts of the documentation are incomplete; feel free to update and add new commands.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 4:15 pm 
Super Tonidoid
Super Tonidoid
Joined: Wed Oct 20, 2010 1:39 pm
Posts: 33

Added time(stamp) - no change

log output:
Code:
15:07:49:117 [1577] [TCPServerConnection (default[#1555])]:T: HTTP Request [192.168.2.133] [GET] [/core/startzip?path=%2Fmedia%2Fusb0%2FMy%20Music%2FiTunes%2FiTunes%20Music%2FThe%20Eagles%2FOne%20Of%20These%20Nights&time=1323118642]
15:07:49:120 [1582] [default[#1560]]:T: CompressActivity Starting.... /media/usb0/My Music/iTunes/iTunes Music/The Eagles/One Of These Nights file Tonido_Zip_135424120691202650.zip
15:07:51:001 [1580] [TCPServerConnection (default[#1558])]:T: HTTP Request [192.168.2.133] [GET] [/core/zipstatus?id=135424120691202660&time=1323118644]
15:08:21:707 [1577] [TCPServerConnection (default[#1555])]:T: HTTP Request [192.168.2.133] [GET] [/core/downloadaszip?id=135424120691202660]


The first zipstatus after startzip returns 1!


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 5:01 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 501

So are you automating multiple downloadaszips back to back?

The way I currently use it requires the user to initiate each one, and if one is in progress the user can't initiate another, so naturally you do get a delay in between. A delay that is based on how long it takes for the user to close the dialogs and initiate a new one.

If you are doing back to back automated zips, I would try a delay. There might be something that requires one; I just can't be sure because I have never automated multiple zips in a row.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: downloadaszip
PostPosted: Mon Dec 05, 2011 5:02 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 7397
Location: Dallas, USA

Are you doing multiple download as zip calls?


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron