Is there any difference between creating a direct link to a file on a server, and doing something like reading the file from a location and setting the content type header then streaming back the data.
I'm curious because I have a webserver that i'm using to download apps to a blackberry, if i create a file and have a direct link to that file it works, but if i stream it back using an webpage it doesn't work. The phone gets the file but it doesn't work.
Things to note:
urls are the same in both cases ie (http://somesite.com/download/file.jad)
in a browser using fiddler the downloads/header are exactly the same byte for byte
So why would the phone prefer a file that's actually a direct link vs one that is a controller streaming the data back when the data transmitted and the url are identical?
The .JAD file is just the first part of the download - there are also the .COD files associated with it (referenced in the JAD). Did you ensure that your "streaming" method is sending back the COD file correctly and with the correct MIME types?
I discovered a fix for this problem though I'm still not sure what causes it. I have been delivering the link to the phone through the sms/email gateway. When the phone gets the sms and I select the link for download it asks if i want to get the jad i hit yes and it shows up and drop out. I put the exact same link on another page as an html link and sent an sms pointing to that page. The web site throws an error... So I copied and pasted the link into the phones browser and the page shows up just fine, I click the jad download link on the page and now the jad works fine.
So i'm thinking two things either there is some sort of security mechanism that prevents direct links in sms(but this has worked for other files) Or the way the phone gets the url is different.
I ran some tests and noticed something else, on a page that accepts an id value (http://site.com/download/145) where 145 is an id for a file, if you go to that link in a phone browser it works fine and you download the file. If you send it in an sms the server errors out saying that the id is expected to be a float and it received a string. So why is it that when the phone links directly from sms the url parameters are strings but when used in a browser the actually get parsed as a float?
Sorry for the long winded explanation but it's a strange issue.
Related
We have a React PWA where we initially download RTF-Documents and save them to an indexDB. We use createObjectURL and an a with a.click() to simulate a download when the file is requested by the User.
The mimetype is set to application/rtf in the createObjectURL call.
However, on iOS (with Safari) the default "view" operation shows the following:
This file cannot be previewed
It might be corrupted or of an unknown file format.
The same file works from our "normal" webapp (i.e. file is served from a backend server). I tried to set the headers exactly like our backend server does, but it either doesn't show the "view" Button at all or it shows the error.
Any ideas how to set up the calls, so iOS will show the RTF correctly?
I am trying to implement an associated domain for an app I'm working on. So far, I have:
Enabled the Associated Domains capability of the app
Added all required domains with applinks:www.domain.com
added an apple-app-site-association file to the root of my server, and when that didn't work also to the .wellknown on my server
This didn't work. When I go to the page that is supposed to open a view controller in my app, it doesn't redirect but only show the banner instead. When I tap the 'Open' button on the banner, however, the right view controller in my app is shown.
Then:
I tried changing the mime type of the file, from application/json
to application/pkcs7-mime.
I verified there is no .json extension
I verified that my server returns a valid response code (200), doesn't redirect, provides the file over https (I havent encrypted
it).
I verified the file has valid JSON.
I even checked in my browser whether it finds the file and it does.
Finally, I have copy-pasted the URL in notepad on the iPhone, long-pressed it and the option 'Open in App' appeared.
Nothing appears to be wrong, yet iOS doesn't link to the app in any circumstances, it only shows the Banner.
What am I missing here? How can I get safari to open my app instead of just showing the banner?
P.S. please note: The website of this project is an asp .net application
I am facing the following problem:
In a web interface, file downloads are triggered with an anchor tag, like this:
<a href="/bla/blabla" download>..</a>
While Safari browser can handle this request and open a dialogue to handle the file, WKWebView treats this just as an ordinary link and does nothing with it. I want to be able to get the file handler dialogue that is normally there when using Safari.
Right now there are 2 problems and I do not see an opening there yet:
I can not detect a click on the element as it is treated just as a normal link. And I can not rely on the URL parameters to detect if it is a file since that is not constantly true.
Even if the URL is defined as a one leading to a file, I can not pass it to Safari since it does not share session info and cookies with my app's WKWebView.
Therefore, I would like to know if there is any opening in handling files in iOS WKWebView. Thank you.
I have an Azure Web App.
The end user can view video files in the application, both with and without encoding.
Without encoding, everything works fine on all client devices-
The file URL in this case looks as following:
videojs: dispatching event: sourceset
[{"src":"https://myAppName.blob.core.windows.net/myAppName/videoFileName.mp4","type":"video/mp4"}]
For encoding, we use the Azure media services.
In this case (with encoding), the file url looks as following:
videojs: dispatching event: sourceset [{"src":"https://myAppName.streaming.mediaservices.windows.net/47686721654-6056-477190467269/5f4404565467771890ab66920d936327.ism/manifest","type":"video/mp4","techOrder":["azureHtml5JS","flashSS","silverlightSS","html5"],"protectionInfo":[{"type":"AES","authenticationToken":"provided"}]},{"src":"https://myAppName.streaming.mediaservices.windows.net/47686721654-6056-477190467269/5f4404565467771890ab66920d936327.ism/manifest(format=mpd-time-csf)","type":"video/mp4","protectionInfo":[{"type":"AES","authenticationToken":"provided"}]},{"src":"https://myAppName.streaming.mediaservices.windows.net/47686721654-6056-477190467269/5f4404565467771890ab66920d936327.ism/manifest(format=m3u8-aapl-v3)","type":"video/mp4","protectionInfo":[{"type":"AES","authenticationToken":"provided"}]}]
When the end user tries to view this encoded video on iphone - IOS, it does not play successfully.
On Windows, it works well.
I read this article about url suffix needed to be added to video file url: specific suffix for each device, but I'm not sure this is the problem.
https://www.returngis.net/en/2014/11/microsoft-azure-media-services-testing-output-formats-in-live-streaming/
I will appreciate your help.
Can you try playing the videos in http://ampdemo.azureedge.net/ and see if that works. If you check Advanced, you will be able to specify specific formats.
I'm trying to write an iOS Objective-C app to login to an old website. Note I don't have control of the website so I have no way of changing the login.
The procedure is:
Open browser at specific URL.
User enters their username and password.
Website returns a file called something like bad_link.smith.
App reads file to get key to use for API.
Is it possible to do this in iOS - open a URL from an app and have the file returned?
You could use UIWebView Delegates for this
Implement this https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/index.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithRequest:navigationType: delegate method and get the URL the user is going to and if the URL matches the URL you want to download then you can get the URL by the NSURLRequest and download it seperately. :) Hope I helped you.
What other thing you could do is make the code native and without the browser and simulating as a browser in the code. Can be used if no CAPTCHA is there. Do tell if you need more info on this.