3 Replies Latest reply on Aug 16, 2011 7:00 AM by saisri2k2

    need help with access local file (security question)

    smart2008_tw Level 1

      dear all:

      i try to load image file from my local disk (E:) but flex alert message that i can not access it, so, how to solve this security question? thank for helping

       

      <mx:Image source="E:\assets\smile.jpg" />

       

      ps:i put my swf file in my web project (WebContent/.......) and run in http://localhost:8080/sample/index.html

       

      index.htm embed swf file

        • 1. Re: need help with access local file (security question)
          saisri2k2 Level 4

          1)first thought, I think it is better to use the relative path than the local system native path(If you cn move the image to the server directory i.,e webcontent). 2) 2nd thought  You need to use any Server code to get the image and send it to the flex UI otherwise if you are planning to deploy it into external server. If any of these does not work then

           

          3) do not run it in server, go to the folder location where you have your flex app and double click open your .html file, that should help you to load the image.

           

          Message was edited by: saisri2k2

          • 2. Re: need help with access local file (security question)
            smart2008_tw Level 1

            dear saisri2k2:

            thank for replaying. this is a shopping cart question

            i think if i move the image to the server directory( i.,e webcontent) i can not show image immediately

            i must stop my web server(tomcat) to rehresh my web project. my goal is trying to implement the shopping cart

            if i add product to database and upload the image to server , how can i show  my image in category immediately?

            i try to upload my image to WebContent/image/assets/, but my tomcat server does not know that image has been uploaded

            i stop my tomcat server and refresh the project, than the image show up. so, how to solve this question?  thank for helping

            • 3. Re: need help with access local file (security question)
              saisri2k2 Level 4

              You can use server code to grab the images and hand it over to the flex client, I think this is better way to implement as you will have complete control on what you are givig to the client. That way you can access everything on the server using the server code(Hopefully). Client should not worry about where it is getting the images.