Flash file upload.. no access to session variables

Hey guys I'm witting a pretty simple web app, and I wanted to add multiple file upload functionality.  Well after much searching I came across a couple different solutions and for now I'm working with MultiPowUpload from element-it; the setup was quick and simple and seemed to work pretty well.  It is written in flash and when each file is uploaded the contents are sent to an aspx page in the background and the contents are fetched with an HttpPostedFile call.  The problem is when the call is made to that page I'm unable to access any session variables, it's as if they don't exist.  I need these session variables to assign where the uploaded files are saved.  I'm not quite sure why this is happening, I'm thinking it's a flash limitation.

 

I've tried a couple different solutions, like putting most of the code in a C# script and read a div element which is dynamically set while I still have access to session variables, but this didn't work.  I'm really pretty lost.  I'm considering storing session variables on the DB, but I've never really done this before.

 

I'm wondering if there is an AJAXian solution to my issue here.  Does anyone have any advice for me? 

0
Shadey216
6/9/2008 1:34:48 PM
asp.net.ajax-discussion 13973 articles. 1 followers. Follow

3 Replies
589 Views

Similar Articles

[PageSpeed] 0

The problem is a bug in Flash Player, which doesn't send the needed cookies. Use cookieless sessions, or find another way to provide the data you need. DB-based sessions won't help, since they rely on the same identifying mechanism as standard sessions. 


-- "Mark As Answer" if my reply helped you --
0
gunteman
6/9/2008 5:30:53 PM

Awesome, thank you.  I will try cookieless sessions, I forgot about that.

0
Shadey216
6/9/2008 6:06:03 PM

Ok turning on cookieless sessions did fix my issue with flash, but now I'm having a whole new issue all together with my AJAX calls.  I'm really lost on where to go with this it's really nasty.  None of my AJAX calls are working, not just my login; they are all failing with the same here, here is the error:

Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost:2800/mixr2/ScriptResource.axd?d=9IiolU8Akxdiyb5VVargKnHiv-dxjVuIxEEP30jgJ-C-hARS7G3eO5GLDuLA8FqtFXdYelLIqBQ_dJ35q9xvwLmDzLyGnKYC-EUgy8i6QfI1&t=633466580523334880 :: Sys$Net$XMLHttpExecutor$get_statusCode :: line 4166" data: no]
return this._xmlHttpRequest.status;
 
Here is my Javascript, it fails right before it hits PageMethods:
 
1    function CallLogin(src,dest)
2    {   
3        $('errorContainer').hide();
4        inputValues[0] = document.getElementById(src[0]).value;
5        inputValues[1] = document.getElementById(src[1]).value;   
6        Effect.Appear('throbberContainer', { duration: 0 }); 
7        PageMethods.AJAXLogin(inputValues, CallLoginSuccess, CallFailed, dest);
8    }
  

 Here is my code behind, everything was working with using cookie sessions:

  

1    [WebMethod(EnableSession = true)]
2        public static string AJAXLogin(string[] loginValues)
3        {
4            clsUser theUser = new clsUser();
5            theUser.UserPass = loginValues[1];
6            theUser.UserEmail = loginValues[0];
7            if(theUser.UserError != null)
8            {
9                return theUser.UserError.ErrorUserText;
10           }
11           clsUser newUser = new clsUser();
12           newUser = theUser.validateUser();
13           if(theUser.UserError != null)
14           {
15               return theUser.UserError.ErrorUserText;
16           }
17           // Had to reset the pw to original text because it's being encrypted
18           newUser.UserPass = loginValues[1];
19           newUser.createUserSession();
20           return null;
21       }
 


If you have any ideas let me know please.  Thanks!

0
Shadey216
6/14/2008 1:31:41 PM
Reply:

Similar Artilces:

After hosting files, problems accessing folders/global.asax.cs file session variables / external classes PLEASE HELP
I've developed an online booking system through visual studio, but now that i am uploading the files to the web, i'm encountering the following problems.I'm trying to access an "Access" Database which i have uploaded in a folder called "Databases" which is a directory above my domain name folder.However, when i try to do so , accessing it with the following line of code.OleDbConnection dbconn= new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source="  HttpContext.Current.Server.MapPath ("../Databases/DatabaseName_DB.mdb"));i get the following error..........Cannot use a l...

access session variables in .asmx file
Hi           Is it possible to access the session variables in .asmx file from any web form? please help me regarding this. Its urgent in my application Thanks in advance   If you're asking whether the .asmx file in a webservice can access the session variables of another web application that is consuming the service, the answer is no, they are separate sessions.  Anything your service needs from the consumer application should be passed explicitly. If you're wondering whether you can use sessions just within the webservice...

how .NET components access Session variables?
hi, i am trying to create a .NET component. its task is to access the Session variable of the page calling it, and return the value as strings. basically i just don't want to pass in the username and all other customed infomation as parameters when i am constructing the component. is it possible to do it? for example: // BranchObject.cs // this code is not working because it complains Page is null. using System; using System.Web.UI; namespace BranchObject { public class BranchUIClass { private string m_user; public BranchUIClass () { m_user ...

Unable to access Session variables in Ajax Methods.
Hi !             I am using AJAX dll. I declared a Session variable(like Session["EmpCode"]="1234" ) in page load() .Now i want to access the session["EmpCode"] from an Ajax method.            But it is giving error "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>"    ...

Access Session Variable in VB.Net Component
Can I access the asp.net session variable (e.g. session("loginId")) in the vb.net componet in case of 3-tier scenario, where I am using one function from the component and I need to access this loginid there.   Regards, onlinedev onlinedev:Can I access the asp.net session variable (e.g. session("loginId")) in the vb.net componet in case of 3-tier scenario, where I am using one function from the component and I need to access this loginid there.     Yes you can. You need to reference the System.Web assembly in the class library, then you go System....

Controlling Folder/File access with session variables
ASP.NET 2.0 -- Is there a way to control access to a folder based on a session variable? For example, Cold Fusion offers a file called application.cfm. This file is read first each time a request is made for any file within a folder that it resides in. If this application.cfm file resides in "/', then it will be read for every file requested in "/" as well, including subfolders. This way you could have more than 1 application.cfm files. So you could place one in the "/admin" folder let's say, and inside the application.cfm file, code would check a session variable, and redirect out ...

Want to access session variable using ajax
 Hi all        I want to access the current session variable using ajax functionality.Can any one tell me how to go about?      Hi you can use the Page methods from ajax extensions , The following example shows how to call static page methods from the client script to write and read session-state values. live demo : http://asp.net/ajax/documentation/live/RunSample.aspx?sref=Sys.Net.PageMethod%23PageMethod.aspx   Demo code : http://asp.net/ajax/documentation/live/ViewSample.aspx?sref=Sys.Net.PageMethod%23PageMethod....

Posting filepath in file upload control in .NET to the next page and uploading the file from second page
In our application (using C# .NET) there is a form with file upload options. After filling up the form details, the summary of the details need to be shown in the next page before committing the information into the database. Right now, Server.Control is used to transfer the contents to the next page and the form details are retrieved using Request.Form["control id"]. But this is not working for File upload control alone.File upload can not be done in the first page itself, as the foreign key in File upload table gets updated only in second page after confirmation. Therefore, is th...

Alter variables in .swf file (C# .NET Flash)
Hello everyone!Im building a simple webform that enables users to load a flashbanner (.swf) and change the contents (eg. text, url, img) in .net. Preferrebly in c#.Conclusion:1. Load a flashbanner (.swf).2. Get the variables (names and values) from the file.3. Alter their values.4. Save it to a new file (or the same, doesnt matter).Why i want to do this is because if I have a banner that i want to send to 10 different places, i dont want to have to make 10 different flashfiles just for changing a bit of text.Is this possible in .net? I've been looking at programs like Aspose Flash and ot...

Accessing Session Object in Code file vb.net
Hi,How do I access Session Object in code file (class1.vb) not code behind file.  This will help me alot in coding my application but it says "Session" object  not declared.  I cannot access response or request objects too.  Any help will be appreciated...plzzzzzThank youcarol You will need to access the current HttpContext, and reference the Session object from there.  You can do that by using: System.Web.HttpContext.Current.Session...

How to access Session variable in global.asax.vb file?
I am having problems accessing a session variable called 'AutoLogin' in Authenticate_Request methid in Global.asax.vb file, which I set when user logs in by clicking on 'Login' button. Can someone tell me how to access session variables in global.asax.vb file? I have tried Session("AutoLogin") and HttpContext.Current.Session("AutoLogin"), but both cause exceptions. sun21170 The Session variable is not yet attached to a request during Authenticate_Request, so you will not be able to use this Property.bill...

How to Debug Response.Redirect losing session variable, when upload file
HELP! I have a page where users can enter text and optionally upload an image. To upload the image, the page contains an image file upload usercontrol I created. The control displays the image after loading and stores the image information to the database and creates an image ID. Then the user can submit the entire page which just saves the user's text and the image ID to the database. In addition, I create a user account for the user and store their new id in a session variable ("LoginID"). When saved, the page does a response.redirect to the next data input page. Excluding the first pag...

Problem using Session variables with Ajax.NET 2.0
I keep receiving the following popup error (below) whenever I attempt to define a session variable inside a Ajax controlled Button.Click method.  Any ideas..? Sys.WebForms.PageRequestManagerParserErrorException:  The message received from the server could not be parsed.  Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.Details: Error parsing near ‘                          ...

Using Session Variables inside a VB.Net Class File
I am developing an asp.net web site, using VB.Net as the core language, and have create a class file to store some global methods I use on a number of pages. When I try to implement a session variable inside a class in this manner:   Imports Microsoft.VisualBasic Namespace ChileNavy.global.SessionVars Public Class SessionVars Public Sub initializeVars() If Session("UserID") Is Nothing Then Session("UserID") = "SomeDefaultSetting" End If End Sub End Class End Namespace   I get an error "Session not declared". Suggesting that the class file sees this is a variable....

Web resources about - Flash file upload.. no access to session variables - asp.net.ajax-discussion

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

AD/CVD ruling and overseas capacity expansions are variables to the current PV boom, says EnergyTrend ...
China's National Reform and Development Commission has announced that there will be no significant reduction in feed-in tariff (FiT) rates for ...

Resources last updated: 12/17/2015 4:11:14 PM