0

The website http://valums.com/ajax-upload/ says that:

Sending additional params

To add a parameter that will be passed as a query string with each upload use params option.

var uploader = new qq.FileUploader({
    element: document.getElementById('file-uploader'),
    action: '/server-side.upload',
    // additional data to send, name-value pairs
    params: {
        param1: 'value1',
        param2: 'value2'
    }
});

My question is: How do I should implement

public JsonResult UploadFile(string qqfile, ????)
{

}

correctly to pass 'value1' and 'value2'?

Thank you!!!

2 Answers 2

2
public JsonResult UploadFile(string qqfile, string param1, string param2)
{

}
Sign up to request clarification or add additional context in comments.

Comments

1

You can use the model binder for that. Create a class with properties, where the names of the properties are equal to the params you send:

public class UploadPostModel
{
    public string param1 {get;set;}
    public string param2 {get;set;}
}

In the action, use the Postmodel. The default model-binder will automatically populate the class.

public JsonResult UploadFile(string qqfile, UploadPostModel pm)
{
    //use the values
}

ofcourse you could also put the qqfile in the Model.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.