Programmatically Upload larger Files in Flex - asp.net

I created an application as part of an ASP.NET site. I would like to receive error notifications in my inbox whenever something goes wrong with that flash application.
As I do not have control over our mail server (which has a different domain name), I cannot establish a cross domain policy allowing me to send error emails to my inbox.
Instead, thought I'd send a request to an ASP.NET handler that sends an email on behalf of the flash app.
Now the problem: the error report should include a screenshot of the flash application at the time the error occurred. The FileReference class however only allows file uploads with user interaction (browse dialog) and cannot be used programmatically to send the screenshot to my ASP.NET handler. The plain old POST back only allows files up to ~200K.
Am I missing something or is there no alternative to :
using POST w/ a compressed or resized screenshot
or forcing the user to first save a screenshot and then select it for upload?
Thanks a bunch!

The problem lay in the receiving web service, not in Flex.

Related

Suprema BioMini slim fingerprint web application

I bought a Suprema BioMini Fingerprint device. It has a SDK, but the documentation is not that good.
What I am trying to do is to create a web application using asp.net that interact with this fingerprint device, The SDK has a working web application that interact with the device.
I've used the Javascripts functions that comes with the sdk as the documentation says, but the following problem shows when I try to capture a fingerprint
(No session cookie is passed)
Have any one face that problem and managed to solve it?
Thanks
How about you enable cookies on your browser and if that does not work you attempt to use another browser to see how it responds?
The other thing could be you are just running the HTML without hosting it on a webserver. If that is the case, check that you are using an appropriate webserver like IIS and confirm if it is running on your test / developer platform.
salam mohammed
when you first log in to the server (from inside your code)
you will recieve a session id with the response.
store this session id, and every time you comunicate with the server, you must send this session id with the request stored in cookie, if you do not send the session id you will recieve this error: (No session cookie is passed).
Please see this link:
http://kb.supremainc.com/knowledge/doku.php?id=en:biostar_2_api_quickstart_guide
That's because you didn't set cookie in your java script codes (refer to page 251 in documentation).

Invoking Reporting Service from Flex using URLRequest and passing credentials using Basic Authorization

I am trying to invoke an SSL based Report server url from within a flex application. I cannot enable Anonymous authentication due to SQL 2008 R2 RS. I am passing credentials with the header by adding Authentication Basic encoded(uname:pwd) header.
The first call that goes out as post comes back with a valid response and my toolbar on top of reports show up fine. But the subsequent calls that the report server url makes internally to get style sheet and the main content etc goes out without the Authentication header, so I get a response back with Unauthorized and user is prompted to enter uname/pwd again.
Is there way to keep the credentials in the session.
No, you will have to send the credentials with every request.
Edit
So I assume your call opens a new window (HTML) where your report will be rendered.
The credentials for Basic Authorization is requested once by the browser first, it keeps it on memory and sends it for you on the next requests.
Try opening a new window and setting the credentials to the browser first, not to the request. Call your link and the browser will take care of that for you.

pass current web credentials from asp.net web application to a windows client application in vb.net

I'm developing a web application that requires the user to log in using forms authentication. inside the webpage you need to download a desktop application that requires to login to the same system too. Is there a way to transfer the current logged credentials from the web application to the windows desktop application without need to login again?. Both applications shares a Login object from an vb.net interface.
I tried to save the IP address in the Database but that don't work for me because the website needs to be accessed inside and/or outside of the company and the user cannot login twice in different machines.
I tried to google for solutions but without luck.
Do you have any suggestions regarding this?
This may not be exactly the scenario you're envisioning, but this article shows how to use Forms authentication from a Winforms client using WCF Authentication Services. This should get you going in the right direction. Per the article, you can use these services in any .NET application.
http://msdn.microsoft.com/en-us/library/bb386582.aspx
This article shows how to do it with a Silverlight app, just so you have another example. http://blogs.msdn.com/b/brada/archive/2008/05/03/accessing-the-asp-net-authentication-profile-and-role-service-in-silverlight.aspx
And just one more for fun. http://aspalliance.com/1595_Client_Application_Services__Part_1.all#Page1
There isn't really any way to share this without encrypting a file containing the user's credentials and storing it on the hard drive along with the file, but then you run the risk of someone decrypting the information and getting access to the user's password.
I think that an alternate approach that could work is to generate an authentication token (could be as simple as a GUID) and store it in your database along with the user's id when the user requests the download. You would want this token to expire after a reasonable time limit (5 minutes, for example).
You could then include a file that contains this authentication token with the download. When your apps starts, you could check for the existence of the file. If it's there, you extract the token, delete the file, send the token prior to presenting the user login.
If the token valid, your server would send back the user's login and your app would proceed as though the user were logged in, otherwise you would just display the login screen.

html form post to flex app

I've got a flex app that is basically completed it uses Zend AMF to connect/supply data.
My app does have a login screen which seems to work fine. Now I'd like to add another login form on my site that would allows users to enter in username/password. When submitted form should pass the data to the flex app and bypass the application's login.
The only way I know how to do this is by passing the users input in the url which is obviously not ideal.
How can I post the form data to use as variables in flex?
There are two more methods I use.
1) Pass parameters to your swf via html embed and read it in swf on load (using FlashVars):
http://kb2.adobe.com/cps/164/tn_16417.html
2) Write login data to browser cookies and read it in swf (using calls to JavaScript in your page via ExternalInterface):
Accessing browser cookies from Flex
I used library from checked answer to the question above, it's working.
Send your user's input to the server trough your form, if the login is successful, open your flex app.
Since it will be on the same session, your flex app will be able to get user’s information from the server and if it's there, bypass the flex app login.

in Drupal, how to make login state consistent between browser pages and embedded XMLRPC client?

I have a Drupal site with user logins. Embedded within this site is a Flash application that shows some data to everybody but allows extra functionality if the user is logged on. From within Flash, I'm using XMLRPC to access the system.check method (to determine whether the user is logged in) and the user.login method (to log in a user from within Flash).
Within Flash, everything works fine. However the Flash login state does not seem to correspond to the rest of the site. For example, if I invoke user.login via XMLRPC, subsequent calls to system.check show that I am logged in, but the Drupal user page still says I'm logged out. Or if I am logged in both places and then I log out via the Drupal user page, the next call to system.check still indicates that I am logged in.
How can I make the login state consistent between the Drupal GUI and my embedded Flash app?
(Note: I am not using any XMLRPC library, I am just constructing the requisite XML manually and sending POST methods using a URLRequest object.)
EDIT: I have confirmed via this question and also via testing with a Web Proxy that the SESS cookie returned by the user login page is being picked up and sent back by the flash application.
EDIT: And now I have shown experimentally that even though Flash (via Safari) is sending the same cookie, it gets back a DIFFERENT cookie when it connects to the XMLRPC service than when it requests and HTML page. In other words, Drupal just doesn't support this kind of synchronization and I'm stuck. I'm accepting the answer below that put me on the right track.
EDIT: AMHPHP is not fully released for Drupal6 as of this writing, but it turned out to be installed on the site anyway. Using the DrupalSite library, I was very easily able to log into and out of the site from flash, and the login remained consistent between flash and HTML.
I'm not terribly familar with Flash, but do the URLRequest objects "inherit" state from the browser session, including the user login cookies? If not, you'll need to explicitly send the login cookie with your hand-built request or Drupal will think that it's just coming from another web browser at the same IP address.
If you're not quite sure, using the Firebug plugin might be useful. It lets you inspect any requests that are being piped through the browser, examine their headers, and look at the raw HTTP response object that comes back.
Update: Even more important than the flash widget getting a session cookie is the flash widget getting the SAME session cookie as the web browser itself. Drupal allows users to log in from multiple machines simultaneously, so if the browser is creating one session and the flash widget is creating another, you'd see the behavior you're describing...
It can't be done.
(For details, please see my final edit to the original question and the equivalent information in my comment to #Eaton.)

Resources