简体   繁体   English

上传文件时只显示手机上的文档。 HTML PHP

[英]show only documents on phone when uploading files. HTML PHP

I have a page which it's only purpose is to upload files from a phone to a computer, I'm willing to make buttons like WhatsApp attachment system where there is a button for documents, another for images, etc. upload page on phone我有一个页面,它的唯一目的是将文件从手机上传到计算机,我愿意制作像 WhatsApp 附件系统这样的按钮,其中有一个用于文档的按钮,另一个用于图像等。在手机上上传页面

  1. how can I share a file from WhatsApp chat directly into my upload page?如何将 WhatsApp 聊天中的文件直接分享到我的上传页面? (if I don't know where its stored in WhatsApp directory if I have like a thousand pdf). (如果我有大约一千个 pdf,我不知道它存储在 WhatsApp 目录中的什么位置)。

  2. if I click the button which is gonna upload a pdf, how to make the file browser show the recent documents like WhatsApp attachment system?如果我单击要上传 pdf 的按钮,如何使文件浏览器显示最近的文档,如 WhatsApp 附件系统?

I tried adding accept="images/*" .. it works fine for images, but when I tried accept="application/pdf" it gives me the three options, when I choose browse files, it shows me the complete browser where I can choose images or pdfs or other extension.我尝试添加accept="images/*" .. 它适用于图像,但是当我尝试accept="application/pdf"它给了我三个选项,当我选择浏览文件时,它显示了我所在的完整浏览器可以选择图像或 pdf 或其他扩展名。

This is a browser feature.这是一个浏览器功能。 The accept attribute tells the browser suggested file mime types. accept属性告诉浏览器建议的文件 mime 类型。 You can always add a mime type check on the server side so anything except pdf files wouldn't be allowed to be uploaded.您始终可以在服务器端添加 mime 类型检查,这样除 pdf 文件外的任何内容都不允许上传。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM