Tangler Discussion Forums

Discuss

Topics

Click a Topicto start discussing

    Sri

    howdy fellas,

     when downloading file using the downloadfile (GetFile?) api, what  distinguish between failure and a successful download of a file with one of the two following contents snippets:

     <response>  
    <result>-20</result>
    <message>Requested resource "path/resourcename" not found</message>
    </response>

    <response>
    <result>-29</result>
    <message>user “user” not found </message>
    </response>

     

    2007-05-20 23:58:41.0

    as a suggestion, only for this request, can we have the server passing a http header that actually indicates a success or failure?

    2007-05-20 23:59:18.0

    My issue with downloadfile is to tell the size of what is being downloaded. The response from downloadfile looks like this:

    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Set-Cookie: r_sessionid=1186609292783_3221551951820651387
    Set-Cookie: edu.yale.its.tp.cas.client.filter.user=Voidmain
    Server: Omnidrive State representation engine v0.7.0
    Content-Type: application/octet-stream
    Transfer-Encoding: chunked
    Date: Wed, 08 Aug 2007 21:41:32 GMT

    Without Content-Length being passed back in the header i'm unable to determine the total bytes of what is being downloaded.

    An example of a response with Content-Length looks like the following:

    HTTP/1.0 200 OK
    Date: Wed, 08 Aug 2007 16:39:11 GMT
    Server: Apache/2.0.52 (Red Hat)
    Cache-Control: max-age=315360000
    Expires: Mon, 28 Jul 2014 23:30:00 GMT
    Last-Modified: Sat, 28 Jul 2007 20:03:44 GMT
    Accept-Ranges: bytes
    Content-Length: 6954
    Content-Type: image/jpeg
    Age: 18838
    X-Cache: HIT from photocache203.flickr.sp1.yahoo.com
    Via: 1.0 photocache203.flickr.sp1.yahoo.com:80 (squid/2.6.STABLE10)
    Connection: keep-alive

    Without the Content-Length being returned the only alternative I see is to get the file properties before downloading. Is there something i'm missing here? Can you get the Content-Length without a header value?

     

    Thanks for any help. -Steve

    2007-08-08 15:00:49.0

    So i've figured out that the Content-Length will not show up if    Transfer-Encoding: chunked

    http://www.jmarshall.com/easy/http/#http1.1c2

    Now it looks like I have the size of the chunk data:

    Example Response:
    Server: Apache-Coyote/1.1
    Server: Omnidrive State representation engine v0.7.0
    Content-Type: application/octet-stream
    Transfer-Encoding: chunked
    Date: Thu, 09 Aug 2007 17:07:37 GMT

    2000
    ID3T2!The Scientist [live in Brussels].........

    It doesn't look like there is anyway to figure out what the total length of the message body will be based on the Chunked stream of data. Can anyone confirm that so i can stop looking?

    Thanks much -Steve

    2007-08-09 10:30:13.0
To send a message, Join Now (it's quick and free) or Sign In
Edit Topic
Delete Topic
Are you sure you want to delete the topic