You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org> on 2012/12/05 14:24:58 UTC

[jira] [Created] (CB-1966) [Question] How to open local files on Android filesystem?

Ruben Vanhoeyveld created CB-1966:
-------------------------------------

             Summary: [Question] How to open local files on Android filesystem?
                 Key: CB-1966
                 URL: https://issues.apache.org/jira/browse/CB-1966
             Project: Apache Cordova
          Issue Type: Wish
          Components: Android, CordovaJS
    Affects Versions: 2.1.0
         Environment: Android
            Reporter: Ruben Vanhoeyveld
            Assignee: Joe Bowser
            Priority: Blocker


I'm looking for functionality to open local files on the Android file system.

The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://

file:/// Gives me a blank white window with the text "undefined".
content:// Does nothing.

How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510864#comment-13510864 ] 

Simon MacDonald commented on CB-1966:
-------------------------------------

[~rubenvh]

I'll say this again. This is not the place to ask questions. This is for reporting issues/bugs. Please ask your question on the PhoneGap Google Group:
https://groups.google.com/forum/?fromgroups#!forum/phonegap

I see you have opened a thread on the mailing list that I will respond to. Please don't add any more comments to this issue as it is not a bug, it is not a feature it is a question.
                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510854#comment-13510854 ] 

Ruben Vanhoeyveld commented on CB-1966:
---------------------------------------

[~anis]:

{code:javascript}
function downloadFile(fileUrl, fileName) { // fileName = someFile.pdf or so
	fileName = fileName.replace(/ /g, '_');
	var remoteFile = encodeURI(fileUrl);
	var localFileName = fileName;//remoteFile.substring(remoteFile.lastIndexOf('/')+1);
	
	window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
		fileSystem.root.getFile(localFileName, {create: true, exclusive: false}, function(fileEntry) {
			var localPath = fileEntry.fullPath;
			if (device.platform === "Android" && localPath.indexOf("file://") === 0) {
				localPath = localPath.substring(7);
			}
			var ft = new FileTransfer();
			ft.download(remoteFile,
				localPath, function(entry) {
					$('#downloadFileResult').html('Downloaded <a href="file:///sdcard/'+fileName+'">file:///sdcard/'+fileName+'</a>>');
				}, fail);
		}, fail);
	}, fail);
}
{code}
                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1966) [Question] How to open local files on Android filesystem?

Posted by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Vanhoeyveld updated CB-1966:
----------------------------------

    Issue Type: New Feature  (was: Wish)
    
> [Question] How to open local files on Android filesystem?
> ---------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CB-1966) [Question] How to open local files on Android filesystem?

Posted by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Vanhoeyveld reopened CB-1966:
-----------------------------------


[~macdonst]: This is a feature request!
                
> [Question] How to open local files on Android filesystem?
> ---------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-1966.
----------------------------

    Resolution: Fixed

Did you try file:///sdcard/file.ext? All files on the SD Card should be accessible to Cordova.  If you need further help, please go to the Google Group.
                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-1966.
----------------------------

    Resolution: Not A Problem
    
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Anis Kadri (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510845#comment-13510845 ] 

Anis Kadri commented on CB-1966:
--------------------------------

Ruben Vanhoeyveld: Can you provide us with a sample code to reproduce the issue?
                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1966) [Question] How to open local files on Android filesystem?

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon MacDonald resolved CB-1966.
---------------------------------

    Resolution: Not A Problem

This is not the place to ask questions. This is for reporting issues/bugs. Please ask your question on the PhoneGap Google Group:

https://groups.google.com/forum/?fromgroups#!forum/phonegap
                
> [Question] How to open local files on Android filesystem?
> ---------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: Wish
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser reopened CB-1966:
----------------------------


Flagged it as fixed, should be "Not a Problem"
                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Vanhoeyveld updated CB-1966:
----------------------------------

    Summary: [Feature req.] How to open local files on Android filesystem?  (was: [Question] How to open local files on Android filesystem?)
    
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510828#comment-13510828 ] 

Ruben Vanhoeyveld commented on CB-1966:
---------------------------------------

[~bowserj], I tried that and I get a white screen saying "undefined"... Now, that's a bug, so it's a problem, so it can be filed here? :)
                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1966) [Feature req.] How to open local files on Android filesystem?

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510844#comment-13510844 ] 

Joe Bowser commented on CB-1966:
--------------------------------

You can file it, but I'll mark it as "Cannot Reproduce" since I just linked to an HTML file on the SD Card.  Here's the HTML that I used:
<a href="file:///sdcard/test.html">Test file in SDCARD directory.</a>

                
> [Feature req.] How to open local files on Android filesystem?
> -------------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1966) [Question] How to open local files on Android filesystem?

Posted by "Ruben Vanhoeyveld (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Vanhoeyveld updated CB-1966:
----------------------------------

    Description: 
I'm looking for functionality to open local files on the Android file system.

The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://

file:/// Gives me a blank white window with the text "undefined".
content:// Does nothing.

How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)


Edit:
[~macdonst]: This is a feature request!

  was:
I'm looking for functionality to open local files on the Android file system.

The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://

file:/// Gives me a blank white window with the text "undefined".
content:// Does nothing.

How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)

    
> [Question] How to open local files on Android filesystem?
> ---------------------------------------------------------
>
>                 Key: CB-1966
>                 URL: https://issues.apache.org/jira/browse/CB-1966
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 2.1.0
>         Environment: Android
>            Reporter: Ruben Vanhoeyveld
>            Assignee: Joe Bowser
>            Priority: Blocker
>              Labels: android, file, local, system
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm looking for functionality to open local files on the Android file system.
> The case for me is that when I download a file, it's stored in /mnt/sdcard/file.ext. But I can't link to the file with file:/// or content://
> file:/// Gives me a blank white window with the text "undefined".
> content:// Does nothing.
> How can I implement some script to open files I just downloaded to the filesystem? (like pdf/doc/...)
> Edit:
> [~macdonst]: This is a feature request!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira