How to serve my own iOS ipa (ipad install) file? - php

Does anyone know how to serve my own files like TestFlight or Diawi ?
I used Firefox web developer tools to let me pick up the header information (from Diawi) then used PHP to set header and readfile to output but this has failed - I have also tried to just reference the file via my web browser but each time my iPad Safari tells me it cannot download this file.

Don't try to download .ipa file directly, you should create manifest.plist file that contains app information and create a link to this .plist file like below.
Than go to this link via safari.
Manifest file should like this : https://gist.github.com/hramos/774468
And you link should like this: itms-services://?action=download-manifest&
url=http://example.com/manifest.plist
You can check this page:
Wireless AdHoc Distribution

There are online tools that simplify this process of sharing, for example https://abbashare.com or https://diawi.com
Create an ipa file from xcode with adhoc or inhouse profile, and upload this file on these site.
I prefer abbashare because save file on your dropbox and you can delete it whenever you want

Related

How to programmatically open a file located in OneDrive using desktop Word?

I have a .docx file in OneDrive. If I click on it, it opens on Word Online. Then, there is a button that says Edit in Word that opens the current file in desktop Word (you have to provide credentials, of course).
Using the OneDrive API, I'm able to open a file directly in Word Online from my PHP application (since it provides the file URL), but now I'm trying to directly open it in Word Offline (and then, Word will prompt the credentials to the user).
TL;DR: I'm trying to reproduce the Edit in Word button behavior. How can I do this?
To open a file in desktop Word from webapp you have to use ms-word protocol:
https://msdn.microsoft.com/en-us/library/office/dn906146.aspx
It looks like: ms-word:ofe|u|<url to file>.
You should be able to trigger opening file by setting above url as a href attribute of a tag or by calling window.open() JS function.
But you need direct URL(not the web url or generated access link) and as far as I'm concerned API doesn't provide such one so you will have to construct it by yourself.
Direct link for OneDrive(personal) looks like:
https://d.docs.live.net/{drive-id}/{file-path}.
You can get your drive id by calling an API(I will use Microsoft Graph because I'm familiar only with this one).
Call https://graph.microsoft.com/v1.0/me/drive/ and as a response you will get a JSON which includes id property and that's your needed drive id.
If you don't want to use Graph API but OneDrive API I guess the only part that changes is graph.microsoft.com and it becomes api.onedrive.com(but I'm not sure, look here for more info - https://dev.onedrive.com/getting-started.htm).
Next you need to provide path to file in your OneDrive. If file is located in root directory the direct url to file might look like this:
https://d.docs.live.net/xxxxxxxxxx/Document1.docx.
That's basically all, now you should be able to open your file in desktop Word by using ms-word:ofe|u|https://d.docs.live.net/xxxxxxxxxx/Document1.docx.

Download file via PHP from FTP, like normally downloading a file?

I am currently trying to retrieve a file from an FTP-Server in order to make it accessible for the user to download. ftp_get() writes it to a path on the local machine, yes, but what I want is that it also shows up in the download history and counts as "normal" download from the internet but I didn't figure out how to do this yet. I also tried to link directly to the file in PHP with header("Location: ftp://username:password#ftp.server.com/myfile.file") but this was resulting in the browser showing the files contents (which I didn't want). Did I miss any header-Parameters ? Or is there a completely different way to do this ?
You won't be able to "redirect" a user to a file so he can download it using FTP. This is a HTTP-thing. Browsers provides FTP features and make it look like HTTP but, in fact, those are different stuff.
If this file is only accessible through FTP and it is on a remote server, the only way I can imagine so you cand 'redirect' this download to the user is:
Download the file from the FTP to your application server through FTP in PHP;
Send it to the user using PHP and appropriate file headers, something like this: https://stackoverflow.com/a/7263943/2802720
Hope it helps.

Why some pdf files are not recognized as pdf in android devices

I am accessing this URL with my android device and the pdf download starts downloading automatically, without asking me to open the pdf vieth the pdf viewer.
This works in other websites.
I am the developer of the website. I set up the header to application/pdf. Any idea what can be the problem? Thank you.
Ok, I identified the problem and found the workaround.
It seems that the native android browser in not very intelligent. In fact, when a file is dowmloaded, the header of the file is not checked. The browser checks only the extension of the file in the url.
In my url, at the end we had /pdf, so no extension was found. By renaming the end of the url to xxx.pdf, the browser was able to recognize the file as a pdf.

Download a torrent with php

I want to download a torrent using php.
So the scenario is that the user uploads a torrent and the server downloads it.
Than the user can download the torrent using his browser.
Dont know if this is the right way for you but:
Install rtorrent (https://wiki.archlinux.org/index.php/RTorrent)
configure rtorrent to watch a direcory for new torrent-files (http://jkt.im/2011/09/28/automatic-torrent-management-with-rtorrent-and-some-helper-scripts/)
rtorrent will download the files and move it into a directory like "done"
php script checks the folder vor new content and convert / show the files online in webpage
All the functionality you need already exist with rTWi http://rtwi.jmk.hu/ and its also open source so all you need is little customization

How to let a user open a file stored on the server?

I have a WordPress site, in which type1 users can upload *.doc files and type2 users should be able to open them by clicking on a link which represents a file.
The file then should be opened in a new window of the browser.
I got the first part easily - there are many guides on uploading a file.
But I couldn't find one that goes through all the steps of getting and opening a file which resides on a server directory.
I assume clicking the link should cause an ajax request which will send the file key to the server.
The server can then get from the MySQL DB the file name and location.
But what do I do then?
How do I get the file from the server directory, send it back to the client and open it for reading in the browser?
Edit:
I want the files to be confidential and not let just anyone read them so giving the users the link for the file on the server isn't the right way.
I still think I need to send the file from the server directory to the client.
How can this be done?
You can add links to uploaded media in WordPress easily. Just remember to link to the actual file:
I want the files to be confidential and not let just anyone read them so giving the users the link for the file on the server isn't the right way.
Yes it is. You can't let people read the document without giving them the document.
If you want to keep it confidential, then require the users to agree not to share the link with anyone else. Or go further and add a layer of authentication + authorisation and also require that users not hand over their credentials.
Simply, redirect the browser to the location of the file. It's depend on user's browser settings that file opens on the browser directly, or user sees open/save dialog.
But, if you want to open the file inside the browser without letting user download it, you should redirect her/him to a custom page. e.g. a page that loads a doc editor.
There's no way to show a Microsoft Word file inside the browser unless they install proper software. e.g. an Applet or ActiveX or something that be able to open MSWord files.
Consider using WP Client File Share plugin.

Categories