mailto: link with attachment

12,379

Why not, as Dennis suggested, link to it, but with the username and password included. You can link to them like this : protocol://username:password@URL . If it's an FTP server the file's on, link to it like this: ftp://client001:[email protected] . If it's a HTTP server (web server) the file's on, link to it like this: http://client002:[email protected] . Safari should support this since it's a main feature of browsers. You make usernames and passwords with a .htpasswd file on apache servers (the majority). If you wanted one username & pass for every client, you could use a really long random string for the username and another the password, like: http://sch7898gdgoj0o05klfckg021167pr0n:[email protected] For example:

mailto:[email protected]?subject=Test&body=%3ca+href+%3d+%22http%3a%2f%2freadonlyclient%3aa7d56a8fd4h9863%40mycompany.com%22%3eDownload+File%3c%2fa%3e

If you're wondering, that's URL encoded.

Share:
12,379
Justin
Author by

Justin

Updated on June 04, 2022

Comments

  • Justin
    Justin almost 2 years

    I made an app for my client that delivers a zip file with the following example structure:

    index.html
    /files/
        file.pdf  
    /inc/
        style.css
    

    Basically, the user will transfer the zip file onto their iPad or iPhone using an app called Sites-2-Go. At this point, they are able to open the index.html file using the iOS browser, and a page listing all the files in the zip is shown. They can click on a link, and it will open the files located in the files folder.

    The reason for doing this was so the Sales people at our company could go around showing our company's products on there iPad without having to connect to the internet. It's basically an offline version of something already available online.

    Anyway, my question is the following: My boss would like to be able to click on an email link beside any of the files listed on the index.html page, and have it be attached to a new email ready to be sent.

    I have been looking into the following syntax:

    mailto:[email protected]?subject=Test&body=Test&attachment=files/file.pdf

    but apparently the "attachment" parameter has never actually worked due to security reasons.

    I was wondering if anyone here knew of some workaround to this?