How to get the path (using < input type = "file" / >)

Hello world

I create a HTML form that has an entry of type = "file".  This will give you a dialog box browse for your user to search for a file on the operating system.

And my code:

function handleFileSelectForMyShop (evt)
{
var blnFileReaderSupported = false;

Try
{

Debug.log ("handleFileSelect", "start handleFileSelect");
reader of var = new FileReader();
blnFileReaderSupported = true;
var files = evt.target.files;
var size = files.length;

Debug.log ("handleFileSelect", "handleFileSelect # selected files:" + size, debug.info);

for (var i = 0; i)< size;="">
{
Debug.log ("handleFileSelect", "in the handleFileSelect analysis the index file" + i, debug.info ");
var f = files [i];
Reader.OnLoad = (function (theFile)
{
Debug.log ("handleFileSelect", "start reader.onload", debug.info);
return Function
{
Debug.log ("handleFileSelect", "start Function", debug.info);

Debug.log ("handleFileSelect", "reading file" + theFile.name + "(" + theFile.size + "") "" + theFile.type, debug.info);

If (theFile.type.match ('image.*')) {}
var path = e.target.result;
alert (path);
create the path

} else {}
jAlert ("Please select photo!', 'Error'");
}
};
})(f);

If ((f.type.match ('image.*')) |) (f.type.match ('audio.*')) | (f.type.match ('video.*')))
{
Debug.log ("handleFileSelect", "in handleFileSelect call reader.readAsDataURL for type" + f.type, debug.info);
Read in the media file in the form of a data URL.
reader.readAsDataURL (f);
}
}

Debug.log ("handleFileSelect", "Complete", debug.info);
}
{} catch (e)
Debug.log ("handleFileSelect", e, debug.exception);
If (! blnFileReaderSupported)
{
Alert('Error.) The FileReader API is not supported. ") ;
}
}
}

function doPageLoad()
{
Try
{
ELE var = document.getElementById ('txtFile_staffInfo');
If (ele)
{
ele.addEventListener ('change', handleFileSelectForMyShop, false);
}
imgSelectPictureClick = 0;
}
{} catch (e)
Debug.log ("doPageLoad", e, debug.exception);
}
}

window.addEventListener ("load", doPageLoad, false);

Note: And alert (path) leads to a Base64 string! It is not a path of the image that I browse a Spain file on the operating system.

I want to have a full path of the file. For example: file:///accounts/1000/appdata/WebWorksAppTemplate.testa3NBcHBUZW1wbGF0ZSAgICA/shared/camera/image01.jpg

I hope to see your reply soon!

Thank you and best regards,

A Pham

A Pham

I think that you can not get the absolute path of a file due to browser security, when you use the

It's something that you need probably a PlayBook extension for.

Tags: BlackBerry Developers

Similar Questions

  • How to get the path or the file name of getChild

    Hey everyone, good day!

    Is - anyone here know how to get the path or the file name of an object inserted into the scene?

    Here's the scenario:

    I am developing a flash application, which allows the user to insert background to the scene to help her browse and select using the FileReference in flash. I inserted some image the user successfully choose, but what I'm trying to make, is that if the user clicks on save, the background image it has chosen will be copied to a different folder on the web (file upload). So I need to know the path and the file name of the background image.

    Here is my AS3 code:

    for (var i: uint = 0; i < container.numChildren; i ++) {}
    trace ('\t|\t' + i +'. \t name:' + container.getChildAt (i) .name + "\t type:" + typeof (container.getChildAt (i)) + "\t" + container.getChildAt (i));
    }

    ------------------------------------------------------------------------------------------ -----

    Here is the message trace of the code above:

    |     0 name: instance120 type: object [object Loader]

    ------------------------------------------------------------------------------------------ --------

    Any help here? I thank in advance.

    The Loader class has a property contentLoaderInfo (an instance of the class LoaderInfo) that contains information, that you are probably after, including the url of the content that has been loaded...

    Loader.contentLoaderInfo.url

  • How to get the path of the vmdk to a VM stop file?

    Hi guys,.

    How to get the path of the vmdk to a VM stop file in ESX Server via the VIX API?

    I try to get it via the VixVM_ReadVariable() function. but it seems that this function requires that the virtual machine is power on.

    I don't want to go the virtual machine started, I just want to know if I can get the path of the vmdk file when a virtual machine is power off.

    Thanks in advance.

    Sorry, I don't have any samples.

    However, if you look at the layoutEx of the managed object VirtualMachine field, you will see that the VirtualMachineFileLayoutEx data object has a field "files" which should contain the paths of affected files.

    I hope that it should be able to help get started.

  • How to get the path of the directory component in custom filter

    How to get the path of the directory component in a custom filter?
    final String absoluteComponentPath = CompInstallUtils.computeAbsoluteComponentLocation( "yourComponentName" );
    
  • How to get the path page dynamically

    Hello.

    How to get the path to the current page in the processRequest of the controller method? e.g. "/ oracle/apps/ak/sandbox sand/webui/SamplePG.

    -wheleph

    pageContext.getParameter ("page");

    This line will give you exactly what you want...
    Thank you
    Annapurneswar

  • Is it possible to use &lt; input type = file &gt; in "folio" android?

    Hello

    I have a composed folio HTML article, where the user can change his image. To do this I use < input type = file >.

    and javascript of the api file. Everything works very well on iPads, iPhones and android browsers. But when this HTML code is

    placed inside folio adndroid, it is not working. Touch the input element does not bring the window 'choose file '. It doesn't do anything.

    I tested it on various devices adroid and versions of the system. I use the latest Adobe Content Viewer (32.5.3).

    This is limitation of folio android?

    See you soon.

    Unfortunately we do not support this type of input on Android.

    Neil

  • How to get the path of the file attached to appliction

    Hello

    I use jdeveloper 11.1.1.3.0

    I have a folder named "Img" attached to my application, I need to get the path of this file running. I used code below to get:

    String relativeWebPath = "/ Img";

    FacesContext facesContext = FacesContext.getCurrentInstance ();

    ServletContext servletContext = (ServletContext) facesContext.getExternalContext () .getContext ();

    String absoluteDiskPath = servletContext.getRealPath (relativeWebPath);

    When I run the application on integrated WebLogic, the true path returns:

    C:\Users\eslami\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\testAddr\ViewControllerWebApp.war\Img

    but when I run the application on server Stanalone, returns null.

    How can I get this path on the server Stanalone?

    Habib

    Hello

    ServletContext.getRealPath () returns null if the servlet container cannot translate the virtual path to a real path for any reason any (for example, when content is made available a .war archive).

    To do this, add the following line in the weblogic.xml:

    true

  • How to get the path of PDF file?

    Hello

    Adobe Livecycle ES2 V9

    Here is the code that I currently use (postSave):

    var fileName = event.target.documentFileName;

    at this point, fileName is (myForm.pdf), there is no path to the file

    fileName = fileName.substring (0, fileName.indexOf("."));

    xfa.host.exportData (".") ("/" + name + ".xml", 0);

    In fact, when the user saves the document PDF an XML file is automatically saved in the same directory with the same name as the PDF file.

    The problem is event.target.documentFileName only gets the pdf and the extension (ex: site_checklist.pdf)

    If the client opens two or more PDF files, it tries to export the XML file in the directory of the first open PDF file (or the last, it have not narrowed down).

    How can I get the path of the current PDF (not PDF more recently opened)?

    I can find no documentation for .documentFileName, I tried documentFilePath too.

    The property you are looking for is the 'path' property: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.411.html

    Here is the documentation for documentFileName: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.389.html

  • How to get the path of the checkpoint of the layer file?

    Hi all:

    the layer has that one video file, is there a way to get the full path of the file? I read the SDK from the AE file, but I can't find the way to get the path of the layer file.le ITEMSUITE8 AEGP_GetTypeName/AEGP_GetItemName/AEGP_GetItemComment, but don't have AEGP_GetItemFilePath.any suggestion will be thankful!

    I think that you need to access the memory behind the handle first:

    AEGP_MemHandle pathH;

    A_UTF16Char * filePath;

    ERR (suites. FootageSuite5()-> AEGP_GetFootagePath (footageH, 0, AEGP_FOOTAGE_MAIN_FILE_INDEX, & pathH));

    ERR (suites. MemorySuite1()-> AEGP_LockMemHandle (file_pathH,reinterpret_cast (& filePath)));

    now the path must be accessible via filePath!

    ERR (suites. MemorySuite1()-> AEGP_UnlockMemHandle (pathH));

    ERR (suites. MemorySuite1()-> AEGP_FreeMemHandle (pathH));

  • How to get the path of placed location plugin

    Hi all

    I want to get the path to my plugin location placed in my custom plugin code.

    supporse my plugin custom:

    C:\Program Files\Adobe\Adobe Illustrator CS5.1\Plug-ins\MyCustomPlugin\MyCustomPlugin.aip

    Is that any API is there who can tell me my plugin path or the path of the directory.

    Concerning

    Ashish.

    Yes, what you want is SPPlugs.h, found in the pica_sp folder. Specifically, you want to GetPluginFileReference(), which takes a SPPluginRef, which is located in any message sent to the plugin. There is always a member of any message:

    SPMessageData d;

    In this (SPMData.h, also in the pica_sp folder), you will find:

    struct SPPlugin * auto;

    That's what you go to GetPluginFileReference(). The result will be placed in a SPPlatformFileReference, which you can pass to the constructor of an ai::FilePath (IAIFilePath.hpp in the main folder of the SDK) and then you will have a pretty nice object where you shoot the full path.

  • ADF: How to get the path of the file when you use component InputFile

    Hi all

    I use jdeveloper 11.1.1.5.0 version.

    in my case, I created program Mail Client mail where I used the ADF InputFile component for attach file mail.

    but problem is this return path only component InputFile from the file (only the filename get)

    and in my mailer class DataSource uses the full path name of file access.

    UploadedFile uploadfile=(UploadedFile) actionEvent.getNewValue();
         String fname= uploadfile.getFilename();//this line only get file name.
    

    so, how can I get the full path using adf InputFile component or any other way to respond to my request.

    Thank you

    Manish

    Try this (I did not, so I can't promise it will work):

    MimeBodyPart messageBodyPart = new MimeBodyPart(uploadFile.getInputStream());
    messageBodyPart .setFileName(uploadFile.getFilename());
    messageBodyPart.setContent(multipart);
    

    It does use the inputStream from the downloaded file as the content of the file attached. You shouldn't need a full path, since you're not going to use a file object to provide the content.  And it shouldn't be necessary to define the DataHandler.

    But if that doesn't work, I go back to my first answer.  Use uploadFile.getInputStream () to get the inputStream from the downloaded file, create an outputStream to write the file to the file system of the application server.  Then you have a file with a known path that you can subscribe to the DataHandler.  You can delete the file when you're done with him.

  • iMac with Thunderbolt - how to get the old analog inputs

    I hang up my old Mac Pro in 2005.  I used it to record video cameras and mainly music best of my plate rotating and stereo system - vinyl and CD disks via s-video and RCA cables and Firewire for Mac Pro.

    The iMac 27 "new is primary Thunderbolt and I can't find a Thunderbolt conversion box so I can enter my analog input RCA and S-video signals.  No indication on the Thunderbolt converters 'both ways' I can't exit analog in the iMAC, then the iMac as well?

    They certainly run Final Cut Pro X on the iMAC, then how people get their old media and music in the machine?

    I'm about to talk to the local Apple store, but the chances of finding someone who knows what they are talking about with the iMac, Thunderbolt and analog input is going to be a stretch.

    Al Donn

    You can probably use a converter DV firewire as a Canopus ADVC 110 http://www.bhphotovideo.com/bnh/controller/home?O= & sku = 349146 & gclid = CLSF0_qUnswC FQ8vaQod9VkFFw & is = REG & ap = y & m = Y & c3api = 187... and then an adapter firewire-crush.

  • How to get the path to the folder

    Hi all

    I need to list all the path of folder like ' / contributor folder/test '. I can get all the "dCollectionID" using the table Collections.
    So my problem is how to get 'dCollectionPath' using 'dCollectionID '.

    Best regards

    Qian

    Hi Qian,

    Can you please mark the thread as an answer?

    Thank you
    Srinath

  • How to get the path applet?

    Hi all

    I want the path of the applet in a class.
    My applet class is abc.java in this file that I can get way using the GetCodeBase method. But the real problem is that I invoke a class of abc.java to xyz.java. So how do applet path in xyz.java. It is not support GetCodeBase method.

    If anyone knows please write.

    Thank you
    -Barros

    Barros says:
    .. If anyone knows please write.

    When people help you with problems, it pays to acknowledge the assistance. After all, this isn't your personal assistance, it is a community of developers who provide advice & tips for free.

    Thank you

    Thanks expresses better by scoring responses as 'useful' or 'correct' and markers such as "answered" if they are. This brings me...

    -Barros

    .. so far I have provided suggestions on * 3 * of your son. If you don't think that my advice is of any help, please say it, & I will stop wasting my time. OTOH if it helped you, mark the answers and discussions as a result.

    TIA

  • How to get the path data graphics (M, L, Q, etc...)?

    I have a shape on the stage and I want to get its graphics data (M, L, Q, etc), I tried the readGraphicsData method, but I could not find the data path & orders!

    var stage_shape: Shape = this.getChildAt (0) as a form;

    var v: vector. < IGraphicsData > = stage_shape.graphics.readGraphicsData (false);

    trace (v);

    output: [object GraphicsSolidFill], [GraphicsPath object], [object GraphicsEndFill]

    trace (v [1]);

    output: [object GraphicsPath]

    Then. How to get path data (178,5 M157.55 Q273.7 188.45 392,5 178,5 L392.5...)?

    Thank you.

    var stage_shape: Shape = this.getChildAt (0) as a form;

    var v: Vector. = stage_shape.graphics.readGraphicsData (false);

    trace (v);

    output: [object GraphicsSolidFill], [GraphicsPath object], [object GraphicsEndFill]

    trace (GraphicsPath(v[1]). Data);

Maybe you are looking for