如何打开我从PC复制到手机的SD卡的HTML文件?
我尝试使用作为HTML查看器的默认应用程序打开它,但我收到"网页不可用" 系统页面。 浏览器显示的URL是:
content://com.android.htmlfileprovider/mnt/sdcard/Documents/To%20Read.html?text/html
任何想法?
谢谢。
如何打开我从PC复制到手机的SD卡的HTML文件?
我尝试使用作为HTML查看器的默认应用程序打开它,但我收到"网页不可用" 系统页面。 浏览器显示的URL是:
content://com.android.htmlfileprovider/mnt/sdcard/Documents/To%20Read.html?text/html
任何想法?
谢谢。
How can I open an HTML file I have copied from PC to SD Card of Phone?
I've tried opening it with the default application which is HTML Viewer but I get a "Web page not available" system page. The URL that the browser shows is:
content://com.android.htmlfileprovider/mnt/sdcard/Documents/To%20Read.html?text/html
Any ideas?
Thanks.
您应该能够使用格式 file:///path/to/file.html
的格式的URL指向所需的文件中的浏览器。例如,我刚刚在我的evo上用我的evo在我的sd卡的根目录中作为 post.html
通过启动浏览器并输入url file:///sdcard/post.html
。
You should be able to point the browser at the file you want with a URL of the format file:///path/to/file.html
. For example, I just did this on my EVO with a file I saved to the root of my SD card as post.html
by launching the browser and entering the URL file:///sdcard/post.html
.
Alternatively, my file manager lets me open an HTML file with "HTML Viewer". This is not as feature-rich, though, and didn't seem to render images for me (whereas the browser way loaded everything properly). My file manager does not give me the option to open the file with the browser, or either of the other browsers I have (Firefox and Opera Mobile).
只是输入 file://localhost/
它在opera mobile中工作。
Just type file://localhost/
It works in Opera Mobile.
如果您的文件是 /mnt/sdcard/test/file.html
,您可以通过浏览器访问它:
content://com.android.htmlfileprovider/sdcard/test/file.html
注意:
您的文件位置不应包含任何空格I.e. /mnt/sdcard/test location/file.html
不起作用,即使URL替换为%20。
另外,书签URL有助于!
If your file is at /mnt/sdcard/test/file.html
you can access it through the browser from using:
content://com.android.htmlfileprovider/sdcard/test/file.html
Note:
Your file location should not contain any spaces i.e. /mnt/sdcard/test location/file.html
doesn't work, even if the URL replaces it with %20.
Additionally, bookmarking the URL helps!
少数人暗示在文件名中具有空格的问题。我会澄清。
Android基于Linux,因此使用POSIX文件系统。这意味着具有空格的文件名导致问题。如果要创建文件或目录,请不要使用空格;将它们留出或使用期限( .
),破折号( -
),或下划线( _
)。要将现有文件加载到其中的空间,必须引用文件。
使用问题替换:
post.html0
:
post.html1
如果否则只需打开文件,则可以引用整个字符串。像这样:
post.html2
除了可能导致问题的空间,POSIX Systems允许Windows中不允许的文件名中的字符。为了避免在系统之间复制文件时的问题,即使在Windows上仍然允许某些文件,请不要在文件名中包含以下字符: post.html3
A few people allude to the issue of having spaces in the file name. I will clarify.
Android is based on Linux, and therefore uses a posix file system. This means that file names with spaces cause issues. Don't use spaces if you are creating a file or directory; leave them out or use periods (.
), dashes (-
), or underscores (_
). To load an existing file with space in it, you must quote the file.
Using the example from the question replace:
content://com.android.htmlfileprovider/mnt/sdcard/Documents/To%20Read.html?text/html
with this:
content://com.android.htmlfileprovider/mnt/sdcard/Documents/"To Read.html"?text/html
If you are otherwise simply opening a file, you may quote the whole string. Like this:
"/mnt/sdcard/Documents/To Read.html"
In addition to spaces which can cause problems, posix systems permit characters in file names that are not permitted in Windows. To avoid issues when copying files between systems, even though some are still permitted on Windows as well, do not include the following characters in file names: / \ ? * : % " < > | + # '
To avoid further problems use a consistent style of capitalization in file names. Note that posix systems are case sensitive, which means file names are case sensitive. This means that file.txt, FILE.TXT, file.TXT, File.txt, georgE.txt, etc. are all different files on a posix system, while they are considered the same file on Windows.
从Verizon上的DROID 4(ICS)我获取浏览器的地址框并键入:
post.html4
然后将其设置为书签。我使用Chrome,不确定我是否可以将其设置为像我的电脑上的归档。这是在我的SD卡上有Lotsa Pix的文件夹。
要隐藏杂乱的PIX,请在其前面的目录中为 post.html5
提供。使用根资源管理器或终端仿真器来检查位置。 我认为 post.html6
可能指向设备内部存储。
On my Droid 4 (ICS) from VERIZON I get the browser's address box and type:
/mnt/sdcard-ext/my_page/index.html
Then set it as a bookmark. I use Chrome, not sure if I can set it as a home page like on my PC. This is on my SD card in a folder with lotsa pix.
To hide the pix from cluttering up your gallery, give the directory a period in front of it like /.my_page/
. Use root explorer or a terminal emulator to check the location.
I think mnt/sdcard/
may point to device internal storage.
从这里下载Android应用程序 - Google Play Store - Openhtml
Download the Android App from here - Google Play Store - OpenHTML
只要将文件重命名为appendinh".html" 。 例如,如果文件名为"ABCD" ,请将其重命名为ABCD.hmtl。这在Android 2.3中为我工作。
Just rename the file by appendinh ".html" to it. For example, if the file name is "abcd", rename it to abcd.hmtl. This works for me in android 2.3.
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有