Recently i've been given the task to create a file uploader that would send the file as it would be read into a webservice.
I found out that All in one code framework already brought one example so i went and changed it to call some WCF services with the data buffer and write the files on the server (so far so good).
Now i would like to add some parameters so i could include them on the service. So i went into the default.aspx and created a textbox with simple values ';' separated.
Problem, whenever i try to read the context.Request.Form this will always throw an error while proccessing the request data and can't upload anything.
if (context.Request.Form != null && context.Request.Form["txtparameters"] != null)
{
info = context.Request.Form["txtParameters"].Split(';');
company = info[0];
section = info[1];
user = info[2];
}
I detected that when i use the code above, the request length is different (bigger) in a few B.
long contentLength = Convert.ToInt64(request.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentLength));
If i want to grab those parameters do i need to change how to proccess the request?
How does this IF make the whole code break?
I've written a very simple project based on the CSASPNETFileUploaderStatus from the 1code team
HERE (hosted on my own mediafire account) if anyone wants to check the full problematic code. Just search for "Alterado". Thats what i've changed in the original code.
PS. company, section and user are global private strings initialized with string.Empty
None
0 Points
1 Post
UploadFile through HTTPModule with parameters
Aug 24, 2011 05:25 AM|JorgeSilva|LINK
Hi,
Recently i've been given the task to create a file uploader that would send the file as it would be read into a webservice.
I found out that All in one code framework already brought one example so i went and changed it to call some WCF services with the data buffer and write the files on the server (so far so good).
Now i would like to add some parameters so i could include them on the service. So i went into the default.aspx and created a textbox with simple values ';' separated.
Problem, whenever i try to read the context.Request.Form this will always throw an error while proccessing the request data and can't upload anything.
I detected that when i use the code above, the request length is different (bigger) in a few B.
If i want to grab those parameters do i need to change how to proccess the request?
How does this IF make the whole code break?
I've written a very simple project based on the CSASPNETFileUploaderStatus from the 1code team HERE (hosted on my own mediafire account) if anyone wants to check the full problematic code. Just search for "Alterado". Thats what i've changed in the original code.
PS. company, section and user are global private strings initialized with string.Empty