[CLOSED] MultiUpload sending parameters

  1. #1

    [CLOSED] MultiUpload sending parameters


    Im using Multiupload so I can upload multiple files at once.
    The files are received and processed by an .ashx file.
    It works fine!

    How can send more parameters to this .ashx page from the inicial page?
    Last edited by Daniil; Jun 24, 2014 at 10:03 PM. Reason: [CLOSED]
  2. #2
    Maybe adding your values to the <PostParams> can help.
    Geoffrey McGill
    Founder & CEO
  3. #3
    Can I see some examples?
    Thank you.
  4. #4
    Sure. Can you provide a simplified sample demonstrating what you have tested so far with PostParams. That will help get us started.
    Geoffrey McGill
    Founder & CEO
  5. #5
    Thats what i have so far:

         FileSizeLimit="500 MB"
         FileTypesDescription="All Files"
            <ext:Parameter Name="IdClass" Value="ContentPlaceHolder1_DDIdClass.value" Mode="Raw" Encode="true"  />
             <SwfUploadLoadFailed Fn="loadFailed" />
             <FileQueued Fn="BeginUpload" />
             <FileSelected Fn="fileSelected" />
             <UploadStart Handler="updateRecord(file.id, 'status', 'Sending');" />
             <UploadProgress Handler="updateRecord(file.id, 'progress', Math.round(bytesComplete / bytesTotal));" />
             <UploadComplete Handler="updateRecord(file.id, 'progress', 1 );updateRecord(file.id, 'status', 'Uploaded' );" />
             <UploadAborted Handler="updateRecord(file.id, 'status', 'Aborted');" />
             <UploadRemoved Handler="var store = this.up('grid').store; store.remove(store.getById(file.id));" />
             <UploadError Fn="uploadError" />
             <FileSelectionError Fn="fileSelectionError" />
            <ext:Button Text="Pesquisar..." />
    Should "ContentPlaceHolder1_DDIdClass.value" be replaced by something else?
    Its here:

    <ext:SelectBox ID="DDIdClass" runat="server" DisplayField="ClassTitulo" ValueField="IdClass" FieldLabel="Classifica??o" OnDirectSelect="DDIdClass_OnDirectSelect" AutoPostBack="False" CausesValidation="True">
            <ext:Store ID="Store3" runat="server" DataSourceID="SqlDataSourceClassList">
                    <ext:Model ID="ModelClass" runat="server">
                            <ext:ModelField Name="IdClass" />
                            <ext:ModelField Name="ClassTitulo" />
    The page UploadDocumento.ashx uses this code to lood for the IdClass parameter:

    IdClass = Convert.ToInt32(context.Request["IdClass"]);
    Thanks again!
    Last edited by geoffrey.mcgill; Jun 24, 2014 at 9:26 PM.
  6. #6
    It worked!
    I've used this:

        <ext:Parameter Name="IdClass" Value="Ext.encode(#{DDIdClass}.value)" Mode="Raw" Encode="false"/>
    Also, the encode=false removes extra caracters when receiving the data and makes my work simpler.


    Thank you!
    Last edited by geoffrey.mcgill; Jun 24, 2014 at 9:26 PM.
  7. #7
    Hi all !

    Well, I´m trying to do the same but in MVC 3.2.1, I don´t know how to read the
    My code looks like this:
                .FileSizeLimit("10 MB")
                    .PostParams(x => { 
                         new Parameter("ResourceID", "App.LayoutsResourcesTreeGridResources.selection.data.resourceID", ParameterMode.Raw);
                         new Parameter("ResourceName", "App.LayoutsResourcesTreeGridResources.selection.data.resourceName", ParameterMode.Raw);
                         new Parameter("ResourceSize", "App.LayoutsResourcesTreeGridResources.selection.data.resourceSize", ParameterMode.Raw);
                         new Parameter("ResourceDate", "App.LayoutsResourcesTreeGridResources.selection.data.resourceDate", ParameterMode.Raw);
                         new Parameter("ResourceType", "App.LayoutsResourcesTreeGridResources.selection.data.resourceType", ParameterMode.Raw);
    public DirectResult CreateResource( FileUploadEventArgs a)
    I have seen other posts using
    Read it directly from Request collection
    , but I guess it's only for WebForms, not MVC.
    What should I add in that code to read that kind of parameters?

    Thanks in advance
  8. #8
    Hello @VilcheS,

    In MVC please use HttpContext.Request.Params["parameter name"].

        var X = Html.X();
    <!DOCTYPE html>
        <title>Ext.Net.MVC v3 Example</title>
            .PostParams(p => p.Add(new { testParameter = "test parameter value" }))
    public ActionResult Upload(FileUploadEventArgs a)
        X.Msg.Alert("PostParams", HttpContext.Request.Params["testParameter"]).Show();
        return this.Direct();
  9. #9

    I had to do little changes in my code:
    .PostParams(p => {
        p.Add(new Parameter ( "ResourceID" , "App.LayoutsResourcesTreeGridResources.selection.data.resourceID", ParameterMode.Raw ));
        p.Add(new Parameter (  "ResourceName" , "App.LayoutsResourcesTreeGridResources.selection.data.resourceName", ParameterMode.Raw ));
        p.Add(new Parameter (  "ResourceSize" , "App.LayoutsResourcesTreeGridResources.selection.data.resourceSize", ParameterMode.Raw ));
        p.Add(new Parameter (  "ResourceDate" , "App.LayoutsResourcesTreeGridResources.selection.data.resourceDate", ParameterMode.Raw ));
        p.Add(new Parameter (  "ResourceType" , "App.LayoutsResourcesTreeGridResources.selection.data.resourceType", ParameterMode.Raw ));
    because I wanted a value from the client like "10090", and not "App.LayoutsResourcesTreeGridResources.selection.d ata.resourceID", but it works :)

    Thx again Daniil

Similar Threads

  1. Replies: 0
    Last Post: Apr 28, 2014, 2:18 PM
  2. Replies: 8
    Last Post: Apr 22, 2014, 7:42 PM
  3. DropdownField value is not sending
    By inf2k in forum 2.x Help
    Replies: 2
    Last Post: Apr 06, 2014, 2:21 PM
  4. [CLOSED] HttpWriteProxy sending parameters in querystring
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 01, 2013, 5:48 PM
  5. Replies: 6
    Last Post: Sep 24, 2013, 6:55 AM

Tags for this Thread

Posting Permissions