Error #2176 Filereference
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to get around Flash error 2176 up vote 2 down vote favorite 1 In my Flex application, users need to be able to upload and download content. However, this content is access restricted, and I need to do a permissions check before allowing the upload/download. The user clicks a link, and then selects a file using the FileReference class. The FileReference class doesn't attach cookie information, so I can't use a session. I want to implement a 2 step process where the client first pings the server to get a one-time-use token, and then does the upload or download with the one-time-use token as a parameter. However, this plan is being foiled by error #2176, which is apparently a security fix to FP10, that only allows uploads/download to be triggered during a MouseEvent propogation. Anyways around this? flex flash share|improve this question asked May 18 '10 at 16:52 limscoder 1,8821223 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted I got workarround for this here. here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Flex's FileReference.save() can only http://stackoverflow.com/questions/2859336/how-to-get-around-flash-error-2176 be called in a user event handler — how can I get around this? up vote 12 down vote favorite 5 I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or http://stackoverflow.com/questions/3301839/flexs-filereference-save-can-only-be-called-in-a-user-event-handler-how-ca keypress event). Otherwise, calling this method results in Flash Player throwing an Error exception." (from the documentation here) This restriction is a bit vague. Does it mean that I can only call the FileReference.save() method from within an event handler function that is registered as a listener for certain types of user events? If so then exactly which user events are valid? (Perhaps there's an event that will never be dispatched by user interaction with my application and I could register an event handler function for that event type and make the save() call from within that function?) My difficulty is that I can't safely call the FileReference.save() method until my web service returns with the data that will be used as the argument of the FileReference.save() method call, so the event that triggers the FileReference.save() call is actually a ResultEvent rather than a user event, and I'm leery of dispatching a new (faux) user event type in order to be able to trigger the FileReference.save() call unless it's definitely a user event that would never be dispatched as a result of actual user interaction with my application. In a nutshell what I'm do 12, 2010 by Bogdan Manate The flash player 10 has new rules for UIA ( user initiated action ) so when I tried to use the FileReference save method I http://www.bogdanmanate.com/2010/05/12/flex-error-2176-when-using-filereference/ got the following error: Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press. After I made some research I found a very cool article here, but I didn't found any workaround. Dispatching a MouseEvent won't work, because the user must interact with the application error #2176 by clicking a mouse button or by pressing a keyboard key. I found a way to get rid of this error by displaying a popup and let the user to click a button in order to force the user to interact with the application.