Accessing Files using the browse method

I am trying to get my application to load images from my local hard drive.  I browse to the image files (no problem so far) by when I select the file to load I get an input/output error.  I CAN load images successfully if they are in the same folder (directory) as the Flash application I am creating.  Is it possible to load image files selected from folders other than the active application folder?

Yes, same error.
If I post my sample code below something may jump out at you...
Rick
import flash.events.*;
import flash.net.FileFilter;
import flash.net.FileReference;
import flash.net.URLRequest;
import flash.utils.ByteArray;
var fileRef:FileReference;
var myFile:String="";
var pictLdr:Loader = new Loader();
new_image_btn.addEventListener(MouseEvent.MOUSE_UP,onBrowseClick);
function onBrowseClick(evt:Event):void {
    try {
        callFile();
    } catch (error:IOErrorEvent) {
        trace("IOErrorEvent catch: " + error);
    } catch (error:TypeError) {
        trace("TypeError catch: " + error);
    } catch (error:Error) {
        trace("Error catch: " + error);
    } finally {
        trace("Finally!");
    trace("Continuing with script...");
function callFile() {
    fileRef = new FileReference();
    fileRef.addEventListener(Event.SELECT, onFileSelected);
    fileRef.addEventListener(Event.CANCEL, onCancel);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
    pictLdr.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
    fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSecurityError);
    var imageTypeFilter:FileFilter=new FileFilter("Image Files (*.jpg, *.gif, *.bmp)","*.jpg;*.gif;*.bmp");
    fileRef.browse([imageTypeFilter]);
function onFileSelected(evt:Event):void {
    //fileRef.addEventListener(ProgressEvent.PROGRESS, onProgress);
    //fileRef.addEventListener(Event.COMPLETE, onComplete);
    trace(fileRef.name);
    //trace(fileRef);
    //trace(fileRef.url);
    //trace (fileRef.name.nativePath);
    var pictURLReq:URLRequest=new URLRequest(fileRef.name);
    trace(pictURLReq);
    pictLdr.load(pictURLReq);
    pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function onProgress(evt:ProgressEvent):void {
    trace("Loaded " + evt.bytesLoaded + " of " + evt.bytesTotal + " bytes.");
function onComplete(evt:Event):void {
    trace("File was successfully loaded.");
function onCancel(evt:Event):void {
    trace("The browse request was canceled by the user.");
function onIOError(evt:IOErrorEvent):void {
    trace("There was an IO Error.");
function onSecurityError(evt:Event):void {
    trace("There was a security error.");
function imgLoaded(event:Event):void {
    pictLdr.content.width=image_mc.width;
    pictLdr.content.height=image_mc.height;
    image_mc.addChild(pictLdr.content);
    //trace("problem is here");

Similar Messages

  • Upload a local file using the path

    I'm trying to upload-on-demand every .MP4 file from an SD card (E:\) to my server when the application starts. So far in my code I have been able to check whether E:\ is valid (the SD card is loaded) and get a list of full paths to the MP4 files on the card. I noticed FileReference and FileReferenceList use the browse() method to select files but couldn't see a method that would allow me a specify a path instead.
    Is there a way to do this? Thanks in advance.

    hi evnafets. You were right! java.io classes didn't solved my problem. So, as you said, I used jakarta apache classes with multipart/form-data form and it solved my problem! thank you very much!!
    And befor finish, let me ask you: do you know how I can make the download now?! Is there a specific class for download like upload?! In my webapplication, the file is stored in database and I can download it in server machine from the own server machine or client machine, but I can't downlod the file in client machine. How can I do that?!
    If you don't know about that, don't worry. You solved my main troble: the upload hehehe. Thank you very much!
    [ ]'s
    afssdn

  • Firefox is using large amounts of CPU time and disk access, and I need to know how to shut down most of this so I can actually use the browser.

    Firefox is a very busy piece of software. It's using large amounts of CPU time and disk access. It puts my usage at low priority, so I have to wait for some time to be able to use my pointer or keyboard. I don't know what it uses all that CPU and disk access time for, but it's of no use to me. It often takes off with massive use of resources when I'm not doing anything, and I may not have use of my pointer for several minutes. How can I shut down most of this so I can use the browser to get my work done. I just want to use the web site access part of the software, and drop all the extra. I don't want Firefox to be able to recover after a crash. I just want to browse with a minimum of interference from Firefox. I would think that this is the most commonly asked question.

    Firefox consumes a lot of CPU resources
    * https://support.mozilla.com/en-US/kb/Firefox%20consumes%20a%20lot%20of%20CPU%20resources
    High memory usage
    * https://support.mozilla.com/en-US/kb/High%20memory%20usage
    Check and tell if its working.

  • What can I do to rectify the situation in which Firefox will not open pdf files in the browser, even though I have already used all the help suggestions to no avail?

    I have tried everything Mozilla has suggested. Still when I click on a pdf, I get the message that the browser cannot open a pdf. I have gone through the help protocol, and it does not work.
    I have uninstalled Firefox and reinstalled it, and still not able to open pdf files within the browser.
    What else do I do, except go to IE or Chrome and just leave Firefox completely???

    A possible cause is the presence of a PDF plugin from an older Adobe Reader plugin in the plugins folder in the Firefox program folder.
    See [[Troubleshooting plugins]]
    See also:<br />
    http://kb2.adobe.com/cps/405/kb405461.html - The Adobe Acrobat/Reader cannot be used to view PDF files in a browser<br />
    http://kb2.adobe.com/cps/836/cpsid_83688.html - I can’t view a PDF document in my web browser<br />

  • When in Windows 7 (using bootcamp obviously) I am able to see my files in my Mac partition. When I try to access them I am told that I need permission from the administrator. How do I give myself permission to access files between the two partitions?

    When in Windows 7 (while using bootcamp) I am able to see my personal files in my Mac partition. When I try to access them I am denied access, it tells me that I need permission from the administrator. How do I give myself permission to access files between the two partitions, Mac/Windows7?

    When in Windows 7 (while using bootcamp) I am able to see my personal files in my Mac partition. When I try to access them I am denied access, it tells me that I need permission from the administrator. How do I give myself permission to access files between the two partitions, Mac/Windows7?

  • How to access the database jar file using the derby 10.2.1.6 database ?

    Hi,
    How to access the database jar file using the derby 10.2.1.6 database ?
    I have used like below. And i am getting the following the error:
    "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)"
    My context.xml file looks like this:
    <Context crossContext="true">
    <Resource name="jdbc/derby" auth="Container"
    type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    url="jdbc:derby:jar(\CalypsoDemo\database.jar)samples"
    username="xxx" password="xxx" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </Context>
    What could be the reason.?
    Any suggestions will be appriciated.
    Thanks in Advance,
    Gana.

    ya, I have restarted. Can you please tell me whether the path which i am giving is right or not in the context file?
    Thanks,
    Gana.

  • Is there a way to share ai or psd files using the cloud with non-cloud clients?

    I am interested in sharing the progress of a work in progress.  I have not used the cloud file storage yet and was wondering if there is a way to give clients access to a specific files using the cloud.

    Yes. Files are either Private or Public. Once a file is made Public anyone with that url can see the page for the file. You can control whether comments or dowloading of the original file is allowed.
    Your client does not need an Adobe ID to view the page, just a web browser.

  • Adding a pre-existing podcast to iTunes U using the feed method.

    While trying to add another pre-existing CSULB podcast to our CSULB on iTunes U (using the "feed" method), I encountered an error message that I don't know how to interpret.
    Can you help me with this or is there somebody else at Apple I should work with?
    The pre-existing podcast is at: http://www.ccpe.csulb.edu/citt/podcast/feed.aspx
    The error message reads:
    "While attempting to download. . . iTunes U encountered an authorization error and could not update the content. Verity your authorization access to the feed specified in the feed URL field, including the user name and password permissions, and then try again."
    I have no idea what this means. Can someone please help?
    Walter

    bgerth wrote:
    Is anyone using Podcast Producer 2 to publish content on iTunes U, and if so, does it work reasonably well (do you recommend using it)?
    Its spiffy. I like it, but I'm a softie when it comes to Apple stuff.
    Am I correct in thinking Podcast Producer 2 can only be used to create an RSS feed to point to podcasts stored in its Podcast Library or can you use Podcast Producer to upload files into our institutional iTunes U storage space (yes we are fortunate to have access to Apple's 500 GB storage space)?
    You can choose to do either. Although I haven't seen anything official, I suspect that Apple prefers the use of Podcast Library…but that's just a preference, not any sort of recommendation or future direction. In the end, I suggest (and I think Apple would agree) that you do what makes the most sense for you. For example, we choose to do it both ways.
    Can you provide a link to instructions (or explain how to either identify in iTunes U that the podcast is in Podcast Producer's Podcast Library as an RSS Feed or how to upload the podcast from Podcast Producer to a specific tab in a specific iTunes tab.
    I believe someone (a friend from Apple…??) released a PcP workflow action that deals with iTunes U the same way as PcPv1 did. Overall, though, probably the best kept PcP secret is that Podcast Producer is a generalized workflow solution. Sure, it's cast as a podcasting solution…but if you can get OS X Server to do something, you can get Podcast Producer to turn it into a workflow…anything. Since OS X Server can be scripted to upload content to iTunes U, Podcast Producer can handle that too.
    I appreciate any information given as I have tried with little success to find this information in either the iTunes U or Podcast Producer Admin guides.
    Thanks!!
    BGerth

  • Open a Microsoft Access file using LV

    Hi, 
        When my VI finishes executing I would like it to Open up a Microsoft Access file and delete an Excel Table.  I have gotten it to delete the Excel Table, however, it will not open the Access file.  I have tried using Open File and I have tried open/create/replace, but they are not working.  I am almost positive I am putting the directory and file extentsion right as well.  I am using LV 6.1.  
    Thanks 

    I have recently added data-basing using labview and access.  I am using labview 7.0 and the DB toolkit.  I have no problem connecting to access using the jet 4.0 engine, where I can read modify and edit access data.  What are you trying to delete? a table, remove entries or delete the entire file itself.  There are two ways to connect to access, using an activeX control or through ODBC.  I have never used activeX for access but have used it for excel, this was not too difficult but there is a lot of methods and properties to wade through to get things working.  I might be able to help you, but will need a little more info on what you need to do with access.  Using the DB toolkit and ODBC, you will not need access on the machine to use the database, which is a nice option if you plan on distributing the application.  I am a DB novice but have been learning fast, I think Mike Porter knows alot about labview and database connectivity, hopefuly he will help out here.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • When I am using the browser for a while and try to use ANY search bar and hit the "search" button it does a whopping NOTHING is there anyway of keeping this from happening?

    Whenever I am using Firefox mobile - either regular, beta or aurora and go to search for something like through the Google search page and attempt to search for something the search bar does nothing and hitting the enter button instead doesn't do anything either. Is there a way to keep this from happening?

    Hi and thanks to not leaving the firefox user alone.
    Cor-el your answer is right as the madperson is and I already knew all these
    answer and I said that before I don’t use any antivirus and I always turn off my firewall from the moment I installed my Windows.
    I even turn off any automatic update for any of my software and I never let any unknown plugins or any thing like that be install without informing me. And if you know some things like Offline Storage and cookies must be to much more than usual and you have to clear them and delete them and I know so much more
    And if you want to know it fixed now. But I don’t know how?
    For understanding my problem read and research about Ixplorer.exe virus it is the same problem about the speed but the different is it doesn’t show any process in task manager like Ixplorer.exe virus
    Bt I have done some things but still I don’t know that’s why it is fixed or not
    First: I searched my system and removed any files have been crated on my system from two days ago since the problem happened.
    And then I used to go about the article in this page and did like this:
    http://answers.yahoo.com/question/index?qid=20080910101846AAazxN5
    but still I don’t know any thing about the problem.
    I can do so many things to fix but I am just curios if that is a virus why it just cut the speed when I am using the browser.
    Please if any one found the reason send me your information I like to know it will improve my knowledge however my problem is solved fro now.

  • There is no printer output when using the PrintOut method

    I have a VB6 app with CR XI, and a customer found a situation that when printing a report directly to the printer using the PrintOut method, there is no printer output or error message.
    Some reports using the same code print normally, but a report that is preceded by another print call, presents this behavior.
    And when the output is directed to the screen, we can see the report.
    Could someone give me an idea of what is the problem?
    Thanks,
    Isis
    SP - Brazil
    The code used is below:
                       Set rpt = applic.OpenReport(App.Path & "SEFoto" + TipoRPT + ".rpt")
                       rpt.FormulaSyntax = crCrystalSyntaxFormula
                       rpt.FormulaFields.GetItemByName("Empresa").Text = "'" + Company + "'"
                       rpt.FormulaFields.GetItemByName("Idioma").Text = "'" + Idioma + "'"
                       rpt.FormulaFields.GetItemByName("Versao").Text = "'" + Versao + "'"
                       ' ... Some lines to compose the selection formula
                       rpt.RecordSelectionFormula = Cond
                       ' To evaluate the image length:
                       Arq = rsTMP3!FT_Arquivo
                       ImageScaling = FatorDeReducao(Arq, "F")
                       ' To reduce the image length:
                       AchouOLE = False
                       For Each oSection In rpt.Sections
                           For Each oObject In oSection.ReportObjects
                               If oObject.Name = "PictureFoto" Then
                                  Set oOleObject = oObject
                                  AchouOLE = True
                                  Exit For
                               End If
                           Next oObject
                           If AchouOLE Then Exit For
                       Next oSection
                       With oOleObject
                            .Suppress = True
                            .XScaling = ImageScaling    ' 0.5 = 50%, 1 = 100%
                            .YScaling = ImageScaling
                            .Suppress = False
                       End With
                       Aguarde.Show 1
                       If DestinoRel = 9 Or DestinoRel = 1 Then ' Padrão ou impressora
                          rpt.PrintOut True              ' <<<---- Here using true or false nothing happens
                       Else
                          PrintRPTtela rpt, "Fotos"   ' <<<--- Here it works fine
                       End If

    Hi Isis,
    Not sure if you have applied any service Packs to CR? If please do so and test again. Then you can upgrade to CR XI R2 for free, use your XI Keycode and download Service Pack 4 from this link:
    https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe
    You'll find the distribution files for your app also from that same download area.
    If you don't want to upgrade to XI R2 then download all patches from XI and test again. This issues rings a bell that it may have been fixed.
    Thank you
    Don

  • Load multiple files using the same data load location

    has anybody tried loading multiple files using the same load locations. I need to do this as the data in these multiple files will need to be exported from FDM as a single export file. the problem i am facing is more user related. since these files will be received at different points of time, users will need a way to tell them what has been loaded and what is yet to be loaded.
    is it possible to throw a window on the web broser with OK and Cancel buttons from an event script?
    any pointers to possible solutions will be helpful

    was able to resolve this. the implementation method is as follows
    take a back up of previously imported data in the befcleardata event script. then in the beffileimport event append the data to the import file. there are many other intricacies but this is the broad implementation logic. it allowed my users to load multiple files without worrying about append or replace import type choices

  • I'm trying to invoke EXCEL or POWERPOINT file into the browser IE 6.0.  The

    I'm running TOMCAT locally on my PC (running Windows NT).
    I'm trying to invoke EXCEL or POWERPOINT file into the browser IE 6.0.
    The output is coming out all scrambled (almost like ASCII code or something),
    where it seems like the applications are not firing up.
    However, an MSWord file shows up fine. So I go to the WEB.XML file in the TOMCAT\CONF
    folder and notice that a MIME type has been set up for MSWord and not the other two.
    I set one up for EXCEL and POWERPOINT but the XLS or PPT files still don't work.
    So, just for kicks, I comment out the MSWord MIME definition but the MSWord file still worked!!!
    I can't figure out what's going on here.
    I'm stopping and starting the TOMCAT service each time I make changes to the WEB.XML file,
    but it seems like none of the changes are taking affect.
    I install all the viewers for MS-Word, ppt, and excell.
    But in Netscape it works fine.

    To support various file formats in IE browser while using window.open like .doc, .docx, .ppt, .pptx, .xls, xlsx etc.,
    The following code can also be used to force any format to get launch outside IE
    For these first configure a filter in web.xml and then include the filter class in given path
    <filter>
    <filter-name>MimeFilter</filter-name>
    <filter-class>com.srk.MimeFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.xls</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.xlsx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.ppt</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.doc</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.docx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MimeFilter</filter-name>
    <url-pattern>*.pptx</url-pattern>
    </filter-mapping>
    and then include the filter class in the declared path
    import java.io.*;
    import java.util.logging.*;
    import javax.servlet.*;
    import javax.servlet.Filter;
    import javax.servlet.http.*;
    public class MimeFilter implements Filter {
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
    HttpServletResponse httpResp = (HttpServletResponse) response;
    HttpServletRequest httpReq = (HttpServletRequest) request;
    String fileUrl = httpReq.getRequestURI();
    if(fileUrl.lastIndexOf(".xls")!=-1)
    fileUrl = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
    httpResp.setContentType("application/vnd.ms-excel");
    httpResp.setHeader("Content-disposition", "attachment; filename="+fileUrl);
    if(fileUrl.lastIndexOf(".ppt")!=-1)
    fileUrl = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
    httpResp.setContentType("application/powerpoint");
    httpResp.setHeader("Content-disposition", "attachment; filename="+fileUrl);
    if(fileUrl.lastIndexOf(".doc")!=-1)
    fileUrl = fileUrl.substring(fileUrl.lastIndexOf("/")+1);
    httpResp.setContentType("application/msword");
    httpResp.setHeader("Content-disposition", "attachment; filename="+fileUrl);
    chain.doFilter(request, response);
    public boolean isLoggable(LogRecord record) {
    return false;
    public void destroy() {
    public void init(FilterConfig arg0) throws ServletException {
    Please let me know your feedback.

  • Can't open PDF files in the browser. I've tried every fix mentioned and it still doesn't work!!!

    I have Windows XP. Using firefox as my browser. Suddenly, I can't open PDF files in the browser. I've tried all the fixes mentioned. Nothing works!!! Checked the plugin settings, checked Adobe Reader settings.

    I already fixed it. I never exited out of Firefox before deleting the mime file. it works now.

  • Export to PDF - Can a single report (rpt file) create multiple PDF files using the export command?

    Post Author: markeyjd2
    CA Forum: Exporting
    Greetings forum members,
    My question is, in its entirety: Can a single report (rpt file) create multiple PDF files using the export command, ideally one PDF file per DB record?
    In my case; I have a Crystal Report that reads data from a DB table containing ~ 500 records.  When I export the report to a PDF file, I get one PDF file, with ~ 500 pages.
    What I would like to do is export the report to ~ 500 individual PDF files; One file per DB record.  The file names would be based on the table's primary key.
    Is this possible?

    Post Author: Micha
    CA Forum: Exporting
    Hi,
    you need some lines of code, but its easy. Dependend on how to start the generation of your 500 PDFs, you can write an ASP page and start it via Web Browser, or a Windows Script and start it via scheduled job...
    Here's an abstract of the ASP code I use:
    First, you create a recordset (here: "rsc") which gives you the list of ID fields you want to export, then you create CrystalRuntime.Application object, then you loop through the recordset, open your report (here: "oRpt") and set login info. Then set the selectionformula, so that the report displays only the data of the current ID, e.g.:
      oRpt.RecordSelectionFormula = "(" & oRpt.RecordSelectionFormula & ") AND {myTab.myVal}=" & rsc("myVal")
    Then you export the report, move to the next record in recordset, and repeat the loop until recordset.EOF. Then you close recordset and connection.
    Micha

Maybe you are looking for

  • Comparing files in a folder with those in another folder with multiple subfolders

    is there a non-terminal tool that i can buy that will do the following?: i want to compare the files that are nicely sorted into nested sub-folders and sub-sub folder in /one/ folder with those that are sitting - in bulk - in another folder. effectiv

  • Forms compiler error 103 - help please

    I am trying to compile form procedure with legal PL/SQL block this type PROCEDURE xy IS CURSOR c_row1_mi IS SELECT x| |y AS row1, ziehung_id, zs FROM (SELECT x, ziehung_id, zs FROM table1 WHERE tm_lo_z_lotto = 'MI' ORDER BY zs desc), table2 WHERE zie

  • Best approach to work with drag & drop functionality

    I m new to java technology & want to implement drag & drop functionality with java web application.so, Please suggest me the best way or best framework or any api to implement drag & drop functionality with java web application.

  • Problem during runtime....

    hi.. can someone help me with a simple program i am creating... Its a program for getting 6 lucky random numbers... everytime i try and run the program, it is able to run, but when i click the button to start to get the random numbers, a problem come

  • TMS Error ....Urgent

    Hi All, We are getting error in STMS.......production system is showing RED. Log details-: Command TMS_MGR_READ_TRANSPORT_QUEUE could not be executed An error occurred in the TMS transport service.   System:         PRD.DOMAIN_DEV   Function:       T