1. #41
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    Hi, anjelika.

    The dialog posts data under 'file' key, not 'uploadedfile'.
    Use the force - read the source.

  2. #42
    Ext User
    Join Date
    Jun 2007
    Posts
    187
    Vote Rating
    1
    anjelika is on a distinguished road

      0  

    Default


    Sorry, I am such a fool.
    It works now, thanks a lot!
    Keep up the good work

  3. #43
    Ext User
    Join Date
    Jul 2007
    Posts
    11
    Vote Rating
    0
    cgriffin is on a distinguished road

      0  

    Default setting base_params

    setting base_params


    I need to set a value for an extra parameter I want to return with the file. This value is set from a combobox. I have the combobox and a listener which gets called when the combobox value changes. I'm just not clear on the syntax to add another submit parameter at runtime. I have tried:

    Code:
       dialog.setBaseParams({leads_source: value})
       dialog.setBaseParams('{leads_source: '+ value + '  }')

  4. #44
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    Quote Originally Posted by cgriffin View Post
    I need to set a value for an extra parameter I want to return with the file. This value is set from a combobox. I have the combobox and a listener which gets called when the combobox value changes. I'm just not clear on the syntax to add another submit parameter at runtime. I have tried:

    Code:
       dialog.setBaseParams({leads_source: value})
       dialog.setBaseParams('{leads_source: '+ value + '  }')
    The first variant should work fine. In PHP you will have $_POST['leads_source'] set to value.
    Use the force - read the source.

  5. #45
    Sencha User
    Join Date
    Apr 2007
    Posts
    172
    Vote Rating
    1
    medusadelft is on a distinguished road

      0  

    Default


    Great tool, but I run against something strange.

    I think it has to do with my JSON-return (I'm on php4, so json_encode doesnt' work). After succesfully uploading the first file, the second file doesn't start automatically. It doesn't matter if I set upload_autostart to false or true. When I click on a file in the grid, it changed the 'abort' button to 'upload'. When clicking this button, the file is uploaded.

    In FireBug it shows these errors:

    On opening the dialog:
    mask has no properties
    http://schanulleke/bvkd/inet/inet_v4...load-dialog.js
    Line 14

    After successfully uploading the first file:
    el has no properties
    http://schanulleke/bvkd/inet/inet_v4...ext/ext-all.js
    Line 10

    After hitting the 'abort' button:
    record has no properties
    http://schanulleke/bvkd/inet/inet_v4...ploadDialog.js
    Line 692



    I'm using Ext 1.1, php 4.3 and IE 6 / FF 2.006.

    Thanks in advance and keep up the good work!

  6. #46
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    I think it has to do with my JSON-return (I'm on php4, so json_encode doesnt' work).
    Can you post here the actual JSON-response, and the PHP code encoding the response into json-message?
    Use the force - read the source.

  7. #47
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    52
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You can't return JSON from a file upload. The response is loaded into an iframe as HTML. The response text is scraped as the innerHTML of the document body.

    That probably won't be valid JSON.

    XML is returned correctly though.

  8. #48
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    Why do you think that the returned json-message will be invalid?
    Use the force - read the source.

  9. #49
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
    southside is on a distinguished road

      0  

    Default Help

    Help


    Hi;

    Your demo looks great, Iam trying to learn EXTJS to create someting just like this.

    I have downloaded your zip, but it is missing upload-dialog-request.php, which I assume is the required file to save the uploads to a file location or mysql database.

    Can you help by supplying the file so I can learn how it is done.

    Thanks.

  10. #50
    Sencha Premium Member MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    497
    Vote Rating
    4
    MaximGB is on a distinguished road

      0  

    Default


    The upload-dialog-request.php isn't missing , the code of upload-dialog-request.php which I use in the demo is following:
    Code:
    <?php
    $response = array(
        'success' => true
    );
    echo json_encode($response);
    ?>
    As you can see it doesn't save uploaded file anywhere and just returns success response in any case. I don't want all that files that visitors uploaded during the demo testing

    If you are using php on the server side then you can get all data required to handle an uploaded file in the $_FILES['file'] variable. The PHP's uploaded file handling is described here
    http://www.php.net/manual/en/features.file-upload.php
    Use the force - read the source.