Help with Web Get... ann downloading a jpg file

98 views
Skip to first unread message

fishingjr

unread,
Apr 2, 2015, 11:50:17 AM4/2/15
to mitappinv...@googlegroups.com
I am trying to download a list of jpg images.  I was able to do this for a long time, however my work place has decided to change the web address of the pics.  Before I did not have to login to view pics but now I do.

If I use Internet Explorer or Chrome, once logged in to the server, I can view all the pics I want and go straight to the address of any pic. just by changing the name of the jpg file:(https://myworkserver.com/web/Photo/123456.jpg)

For AppInventor, I can save my username and password in html and login using a script with webviewer.  However when I use the Web Get I do not get the jpg file to download.

When I use the Web Get, I do get a file to save with the correct name... 123456.jpg  However, it is not a jpg file and this is the contents of that file:

<html>
    <head>
        <META HTTP-EQUIV="expires" CONTENT="0">
    </head>
    <body>
        <form method="POST" enctype="application/x-www-form-urlencoded" action="/nidp/idff/sso?id=6&sid=0&option=credential&sid=0"></form>
        <script language="JavaScript">
            <!--
                document.forms[0].submit();
            -->
        </script>
    </body>
</html>


Can anyone tell me why I'm getting this html back and not the jpg file?  Any Suggestions?


I made a simple apk just do demonstrate my problem...



Help with Pic Download.jpg

Taifun

unread,
Apr 2, 2015, 12:18:55 PM4/2/15
to mitappinv...@googlegroups.com
This example shows how to download a file from a password protected area to your device
https://puravidaapps.com/filedownload.php#restricted
Taifun

fishingjr

unread,
Apr 5, 2015, 1:02:03 AM4/5/15
to mitappinv...@googlegroups.com
Thanks Taifun, 

I'm looking at this and trying it... But still not having any luck.  It maybe the difference of the way the server accepts logins.

I can access your private server, both from the IE and from an App-inventor app.  I change the settings to my work server and it does not work.  The difference maybe that my work server submits the Username and Password thru a FORM SUBMIT. 

I saved the HTML source of my work server login screen and I have created variable in App-Inventor to insert Username and Password in the HTML as VALUE= in the input part of the form.  Using this saved HTML, I can use Web-Viewer to log into my work server and view any JPG image in the Photo folder.  I wish there was a way to save a file from Web-viewer or create a script in my HTML to save a jpg file to sdcard.

Do you happen to have anymore suggestions?

Thanks for your help!!!
Reply all
Reply to author
Forward
0 new messages