Reputation: 1018
I'm a little lost on how to achieve this problem.
We have a list of files brought into a app linking to the files stored on a remote server. Currently when the file is selected in the list, it opens up within safari which is fine. Once the file loads in safari you do have the option for forward from there, but my client wants to be able to it from within the app, rather than opening in safari.
We are using query mobile and phone gap to create the app. I was thinking about just creating a new mail, with a link to the file embedded in to the email.
Any ideas or help is welcome on this.
Upvotes: 0
Views: 356
Reputation: 1018
I have created a link:
<a href=\""+url+"\" target=\"_blank\" data-role=\"button\">Open File</a><br/><a href=\"mailto:?subject="+title+"&body=Please%20find%20below%20a%20link%20to%20the%20file%3A%20"+title+"%0A%0A---------------------------------------------------------------------------------------------------%0A"+url+"%0A---------------------------------------------------------------------------------------------------%0A%0A\" data-role=\"button\">Email File</a>
Which has seemed to do the job, opens up the default email client, with the set values in them.
Upvotes: 1
Reputation: 13115
You may be much better off if you just have the mobile app make an Ajax call to the server to trigger the sending of the email and attachments? That would really reduce the complexity off the mobile app and decouple you from any issues that might occur based on different hardware or OS's.
So when the user is viewing the list of files, maybe offer them two buttons. View and Send. View would open in Safari as intended, Send would make a call to the server to do the heavy work.
http://yourserver.com/sendFilesToRecipient?file_id=XX&[email protected]
Then the server loads the correct file and sends it out, maybe responding the client app with a success/failure message.
Would that type of design solve the issue?
Upvotes: 1