Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I have an .htm file in a dropbox folder with the following content:

<p>this is a <b>test</b> of html</p>
<img src="test.png"/>

When I view it on my PC, it shows the image (which is in the same directory as the htm file).

However, when I view it on my HTC Wildfire and choose as the viewing application "HTMLViewer", it shows me the correct HTML rendering (with bold) but shows me a broken image.

How can I view HTML files with image tags in my dropbox folder on my Android phone?

share|improve this question
1  
Similar problems has been reported (though it is 1 year old). I'm guessing the issue is with the app. Doesn't your default android browser open HTML files ? –  Abhirup Manna Aug 12 '11 at 16:00
4  
Is the image actually on your device? The Dropbox app doesn't automatically download files to your phone, it just lists the files on your account. You need to open a file (or long-press and hit download) to actually get it on your device. I tested this and as long as I download the image first it works fine. If you enable the file status icons in the Dropbox settings anything without a green check has not actually been downloaded to your phone yet. –  eldarerathis Aug 12 '11 at 16:21
    
@eldarerathis that was a good idea, but even after loading the image onto my phone the html page still shows it is broken, as if there is something wrong with the path, i.e. as if there is an absolute path, strange. –  Edward Tanguay Aug 15 '11 at 20:33
    
@CustomiZer when I hold my finger down on index.htm, then choose open, it gives me the choice between (1) Text Editor DB, (2) HTMLViewer, (3) HTML Visualizer DB. How do I tell it to "use the Android browser?" –  Edward Tanguay Aug 15 '11 at 20:36
    
I did some testing on different handsets and discovered that some like mine allow opening of htm file using default browser (dropbox not installed) and some gave an option like text, HTML viewer. I'm not really able to understand the cause of the problem. Try some other webpage and check if you still get the broken images. –  Abhirup Manna Aug 15 '11 at 20:57

2 Answers 2

I have DropBox installed on my Moto DROID v1 (Android OS 2.2.2). I placed an HTML file that referenced an image in a DropBox folder. The image was in a sub-folder.

  • DropBox\Folder\index.html
  • DropBox\Folder\img\image.jpg

I first downloaded just the index.html and opened it in the HTMLViewer. The image link is broken. I then downloaded the image.jpg file, then returned to index.html and viewed in HTMLViewer. The image now appears properly.

I'm not sure if it has anything to do with it, but you may want to try switching your file extension to .html, and verify that the doctype of your file is set properly:

<!DOCTYPE html>
share|improve this answer

The Dropbox app for Android doesn't save files to a "folder" like the PC version does. Android has stronger security and doesn't let apps access other apps' files, so even if it did do that, the browser wouldn't be able to read the image.

When you choose to open a file that's listed in Dropbox, the Dropbox app creates a special URI that points to that one file. It uses an intent to start an activity to view that URI, and sets a special flag to say that the new activity (in this case, the web browser) has permission to access only that URI. That means that there's no path you can put in the HTML file that lets the browser read the image: it has Dropbox's permission to read only the file you clicked on.

If you want to have a directory of HTML files and images that all load in the browser, you need to store it on the SD card (rather than in one app's data) where any app can read and write any file. I don't believe the Dropbox app has the feature of being able to sync directories on the SD card, but you could use another app to achieve that. For example, you could use an FTP client to sync the directory with one on an FTP server.

The answers to this question have lots of suggestions for how to keep directories in sync with Dropbox or another server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.