Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to pass uploaded file to asp.net webmethod with other parameters.
I know how to use handlers. But my function is like,

[webmethod]
public static void(string name,??)
{
here I call asmx webservice to pass name. now how can I pass the file uploaded? What type of parameter to pass(in place of??) from jquery ajax call so that I can pass that to asmx service?
}

In handler I can't do this in a single function. Here concept is,first the name will be saved,unique id will be returned from sql,then I'll name the file with the id and save to folder. The saving concept I have to write fully in the asmx webservice.

So if I can pass the file from jquery/ajax call with the name parameter,that will be best obviously,but you can tell other methods.

What I have tried:

I tried with handlers but can't achieve what I need.
Posted
Updated 2-Jun-16 4:51am

1 solution

You can use FileReader[^].

Send the contents to server side and then work with that binary data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900