3 Replies Latest reply on Nov 6, 2007 11:58 AM by buabco

    Web-based, access local files, possible?

    DCalisuni Level 1

      Alright,

      My dilema: I have an application in which I upload photos to a server. I would like to make manipulations to that photo without uploading and then downloading it.

      As you know, you cannot:
      1) Access local files on the machine unless it is running on the machine. If it's running locally, you cannot pass specific information to that swf from another window.

      2) (Using FileReference) Access the local url of the selected file due to restrictions in the class file.

      Has anyone heard of a workaround for something like this?
      I appreciate it much.
        • 1. Re: Web-based, access local files, possible?
          buabco Level 1
          HI!

          I've got the same problem myself, I've never been able to understand why adobe boqued the access to the file before you send it. I made a bouncing script on the server to get the file back and solved my problem but still I think is a bit inefficient.

          I've thought of two alternatives to go over the restriction but haven't had the time to try them yet. So if you do try them, let me know of the results:

          First: use a javascript: URL on the fileReference so it will send the file to a function that maps back to the flash application. If that's not blocked it could be a nice solution even though it will probably require some decoding.

          Second: use javascript directly to access the file and then get the data, I played with that and was successful in accessing the file system through that, but there where to many security warnings to my liking.

          • 2. Re: Web-based, access local files, possible?
            DCalisuni Level 1
            Guten morgen!
            Thanks for the reply. It's nice to know I'm not the only one challenging adobe's decision of a certain "restriction" of which I will not mention. I've already gone through the hassle of sending and returning myself, and I agree; it is a bit inefficient.

            quote:

            First: use a javascript: URL on the fileReference so it will send the file to a function that maps back to the flash application. If that's not blocked it could be a nice solution even though it will probably require some decoding.


            I can foresee this being a problem, because you cannot put a url into FileReference unless it is download() (I think) and that would serve as pointless because you'd be downloading from his/her own machine and still not have access to the file. Second, I think javascript has a similar restriction on the file chooser. I will do some investigation on this one; however, even if they don't, more problems are: 1. The platform variable; 2. The browser variable.

            quote:

            Second: use javascript directly to access the file and then get the data, I played with that and was successful in accessing the file system through that, but there where to many security warnings to my liking.


            This sounds more feasible, but I'm curious. By which method are you passing the data, and what warnings are you getting?
            • 3. Re: Web-based, access local files, possible?
              buabco Level 1
              Well, Actually I never got that far as to send the read data to the Flash application, the reason where basically 2, first Apollo came out witch has local file access, and second that to open the browser to the file system from javascript produced to many warnings, I tried with both explorer and firefox. I couldn't find the code I use for testing, but in explorer was as simple as to add the FileSystem objects to javascript and the ALLOW question will come out.

              In Firefox was far more complex and you needed to activate some strange mozilla classes. What I do can tell you is that all the functions are there if you want to try. But still it sounded a lot more simpler to use an Adobe AIR application and some localconnection to access the fileSystem. In fact I'm planning on doing some experiments on that in the future.