08-24-2011 05:58 PM
Hi.. I have an app that allow to select a file (image) and then show it on the screen
My problem is on recent browsers the path of the file is hidden by the "C:\fakepath" sentence... i.e "C:\fakepath\image.jpg"
I need the absolute path because I have to read the file and then show it like
<img name="image" id="image" src= "data:image/jpg;base64,[...data...]"/>
But i can't open the file because i can't get the absolute path...
Then I proved to send the image to a server and then received the blob data again..
<form name="form" method="post" action="upload.php">
<input type="file" id="uploadedfile" name="uploadedfile"/>
<input type=hidden name="fileid" id="fileid" value="123"></input>
<input type="button" onclick="upload()" value="presiona"/>
But it takes me to a new page (a blank page because server is not sending a response by now) from server and I can't go back to the application again..
Please.. I will be very thankfully if you can help me to find a solution..
08-27-2011 03:58 AM
If you are selecting the image from the shared location then there is a constant value for the filepath exculding the filename. You could fix a constant for this path. And then append your filename to this path. Filename can be obtained like below on the file onchange event
; imagesrc=imageSrc.toString(); var imageName = imageSrc.split("fakepath");
where fileType is file type tag id and imageName gives you the filename. In case of Playbook the constant path is 'file:///accounts/1000/shared/camera'
02-20-2012 03:15 PM
I am trying to do the exact same thing.
If I have the following in my config.xml file:
<rim:permissions> <rim:permit>access_shared</rim:permit> </rim:permissions>
But I still get fakepath back when i get the value of the input, though the input displays the real path to the user.
Should I not have access to the full file path?But it is possible the user is selecting a a text file as well. If they select a text file I would like to be able to read the text file and show a preview of it's content.
Does developing a webworks app prevent me from all filesystem access?
Does the <rimermissions> tag work with ripple? I don't see that section showing up in the config validator in ripple (lower right had corner).