Android Question D/L from hyperlink?

stanks

Active Member
Licensed User
How? In browser when i click on hyperlink i get save as dialog with filename.xml i tried with Job.GetString and Job.GetInputStream but i don't get xml file but other file (looks like html file)

Thanks
 

sorex

Expert
Licensed User
@stanks you didn't provide all info.

his link is a querystring with a parameter (index.asp?id=xx or something)

as I told you on the chat you have these possible issues

- your get request is wrong
- you use post which causes the parameters to drop off unless you use it right
- they added a referer check to be certain that the page only gets opened through their site, then you need to send their referer url with the request.
 

stanks

Active Member
Licensed User
B4X:
<!DOCTYPE html>


<html id="XenForo" lang="en-US" dir="LTR" class="Public NoJs LoggedOut NoSidebar  Responsive" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>

   <meta charset="utf-8" />
   <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
   
     <meta name="viewport" content="width=device-width, initial-scale=1">
   
   
     <base href="http://www.b4x.com/android/forum/" />
     <script>
       var _b = document.getElementsByTagName('base')[0], _bH = "http://www.b4x.com/android/forum/";
       if (_b && _b.href != _bH) _b.href = _bH;
     </script>
   

   <title>B4A Question - D/L from hyperlink? | B4A (Android) / B4i (iOS) / B4J Developers Community</title>
   
   <noscript><style>.JsOnly, .jsOnly { display: none !important; }</style></noscript>
   <link rel="stylesheet" href="css.php?css=xenforo,form,public&amp;style=1&amp;dir=LTR&amp;d=1418223860" />
   <link rel="stylesheet" href="css.php?css=bb_code,login_bar,message,message_user_info,share_page,thread_view,toggleme_auto,toggleme_manual&amp;style=1&amp;dir=LTR&amp;d=1418223860" />
   
   

   <script>

   var _gaq = [['_setAccount', 'UA-1987329-1'], ['_trackPageview']];
   !function(d, t)
   {
     var g = d.createElement(t),
       s = d.getElementsByTagName(t)[0];   
     g.async = true;
     g.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     s.parentNode.insertBefore(g, s);
   }
   (document, 'script');

   </script>
     <script src="js/jquery/jquery-1.11.0.min.js"></script>   
     
   <script src="js/xenforo/xenforo.js?_v=6763c268"></script>
   <script src="js/sedo/toggleme/toggleME.js?_v=6763c268"></script>

   
   <link rel="apple-touch-icon" href="http://www.b4x.com/android/forum/styles/default/xenforo/logo.og.png" />
   <link rel="alternate" type="application/rss+xml" title="RSS feed for B4A (Android) / B4i (iOS) / B4J Developers Community" href="forums/-/index.rss" />
   
   
   <link rel="canonical" href="http://www.b4x.com/android/forum/threads/d-l-from-hyperlink.48468/" />
   <meta name="description" content="How? In browser when i click on hyperlink i get save as dialog with filename.xml i tried with Job.GetString and Job.GetInputStream but i don't get xml..." />

<link href='http://fonts.googleapis.com/css?family=Noto+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/xf_forum.css" />
<script src="/js/jquery-ui.js"></script>
<link rel="stylesheet" href="/js/jquery-ui.css">

<script src="/js/jquery.watermarkinput.js" type="text/javascript"></script>
<script src="/js/headers.js" type="text/javascript"></script>

   


   






</head>

<body class="node26 node25 SelectQuotable">

<!-- **************** -->
<input type="hidden" id="name" value="forum"  />
<!-- headers -->
<div id="headers" class="pageWidth" style="position:relative;left:0px;">
   <img id="bg" src="/images/Header-bg.png"/>
   <a href="http://www.b4x.com/android/forum/"><img id="anywheresoftware_logo" src="/images/Logo_on-dark.png"/></a>
</div>
<div id="menu" class="pageWidth">
  <div id="home"><a href="/index.html">HOME</a></div>
  <div id="b4a"><a href="/b4a.html">B4A</a></div>
  <div id="b4i"><a href="/b4i.html">B4i</a></div>
  <div id="b4j"><a href="/b4j.html">B4J</a></div>
  <div id="store"><a href="/store.html">STORE</a></div>
  <div id="forum"><a href="/android/forum/index.php">ONLINE COMMUNITY</a></div>
  <div id="search_div" title="Press enter to submit query.">
     <form id="searchform" action="http://www.b4x.com/search">
       <input id="search" type="text" name="query" />
     </form>
   </div>
</div>
<!-- headers end -->




   
<div class="pageWidth">
<div id="loginBar">
   
     <div class="pageContent">   
       <h3 id="loginBarHandle">
         <label for="LoginControl"><a href="login/" class="concealed noOutline">Log in or Sign up</a></label>
       </h3>
       
       <span class="helper"></span>

       
     </div>
   
</div>
</div>


<div id="headerMover">
   <div id="headerProxy" style="height:40px;"></div>

<div id="content" class="thread_view">
   <div class="pageWidth" >
     <div class="pageContent">


       <!-- main content area -->
       
       
       
       
             
             
             
   
Message longer than Log limit (4000). Message was truncated.
(BufferedInputStream) java.io.BufferedInputStream@429cf920
[code/]
 

stanks

Active Member
Licensed User
Sorex i tried with job1m.GetRequest.SetHeader("Referer", "mylink") but result is the same
for getting that file i use only job1m.Initalize, job1m.Download(url) and nothing more....that is all code
 

sorex

Expert
Licensed User
it might be a mime type issues or something else but without the url we can't tell you what goes wrong.
 
Top