[Midas] Fwd: Midas Contact

Zach Mullen zach.mullen at kitware.com
Tue Jul 3 11:02:24 EDT 2012


What you're seeing is an empty zip file when trying to download the item.
 That's because the permission check failed, which is actually a bug on our
side because we are redirecting to a new controller that doesn't know about
the api auth mechanism.

As a workaround, is your client able to handle cookies?  If so, you could
use session-based authentication instead of the token.  If the client
you're writing is javascript that lives on the same server, you can simply
pass the "useSession" parameter instead of the token, and javascript
automatically passes the appropriate cookie.  Java applets do the same
thing.  If your client is something else, you could store and pass the
cookie manually.

I will work on fixing this bug for now.  Thanks for the report.

On Mon, Jul 2, 2012 at 8:36 PM, Mona Wong <mona at sdsc.edu> wrote:

>
> Hi Midas:
>
> I'm posting this on behalf of our developer who just signed up for the
> mailing list but has not been given permission to post yet...
>
> Begin forwarded message:
>
> ---------------------------------------
>
>
> I have a question about web API midas.item.download. I have access to two
> items whose id are 18875 and 18876, respectively. Item 18875 is in user A's
> public folder. Item 18876 is in user A's private folder. For testing
> purpose, the contents of these items are actually same. I can access and
> download both items through Midas web interface.
>
>
> Now, I want to download them using web API.
>
>
> First of all, I used midas.login and get a token. By calling
> midas.item.get, I got the information about each item. So far so good.
>
>
> My next step was to download item 18875 using midas.item.download, and it
> worked great.
> However, when I tried to download item 18876 using a similar command, it
> didn't return me the expected file. The command was:
> C:\test>curl -d "token=mytokenvalue&id=18876" -L
> http://midas.test.edu/midas/api/json?method=midas.item.download
> PK??
> C:\test>
>
>
> What I got is several non-ASCII characters (PK??). I also tried to
> download using Google Http Client and got the same result. Please help!
>
>
>
>
> ------------------------------
>
>
>      *********************************************
>     Mona Wong
>     Web & iPad Application Developer
>     San Diego Supercomputer Center
>
>     Believing we are in control is an
>     illusion that brings suffering.
> *********************************************
>
>
>
>
>
>
> _______________________________________________
> Midas mailing list
> Midas at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/midas
>
>


-- 
Zach Mullen
R & D Engineer
Kitware Inc.
919-869-8858
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20120703/0d10f2c3/attachment-0001.html>


More information about the Midas mailing list