开发者

mailto: link with attachment

开发者 https://www.devze.com 2023-03-28 07:19 出处:网络
I made an app for my client that delivers a zip file with the following example structure: index.html /files/

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:johndoe@gmail.com?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?


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:a67b1f@nuk.eu . If it's a HTTP server (web server) the file's on, link to it like this: http://client002:f677gj@nuk.eu . 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:45906igfd49ps316fyh1zagf364z@peanutbutter.org For example:

mailto:johndoe@gmail.com?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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号