Hi Nifras,

You can get multiple uploaded-files inside your Jaggery code using
request.getAllFiles() function. e.g.

var files = request.getAllFiles();   // returns <name, File> map
for(var name in files) {

if(files.hasOwnProperty(name)) {

var file = files[name];

// do something with file

}

}


Thanks.

On Fri, Sep 18, 2015 at 7:08 AM, NIFRAS ISMAIL <nifrasism...@gmail.com>
wrote:

> Hi Sajith,
> Thank you for the guide.
> So we can add multiple files upload from this stream.
>
> Regards.
> *M. Nifras Ismail*
> [image: LinkedIn] <http://lk.linkedin.com/pub/nifras-ismail/54/343/94b>
>
>
>
> On Fri, Sep 18, 2015 at 12:32 AM, Sajith Ariyarathna <sajit...@wso2.com>
> wrote:
>
>> Hi Nifras,
>>
>> request.getFile("myFile") does not represent a physical file, rather it
>> represent a stream to the uploaded file. Hence you cannot "move" it using
>> .move("...") function. If you want to save the uploaded file, then use
>> the following code snippet.
>>
>> var uploadedFile = request.getFile("myFile");
>> var savedFile = new File("/path/to/save/location/" +
>> uploadedFile.getName());
>> savedFile.open('w');
>> savedFile.write(uploadedFile.getStream());
>> savedFile.close();
>>
>>
>> Thanks.
>>
>> On Thu, Sep 10, 2015 at 2:41 PM, NIFRAS ISMAIL <nifrasism...@gmail.com>
>> wrote:
>>
>>> Hi All,
>>> Do we upload images to the server directly using Jaggery JS?
>>> http://stackoverflow.com/a/32497617/2672566
>>>
>>> Regards.
>>> *M. Nifras Ismail*
>>> [image: LinkedIn] <http://lk.linkedin.com/pub/nifras-ismail/54/343/94b>
>>>
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Sajith Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> mobile: +94 77 6602284, +94 71 3951048
>>
>
>


-- 
Sajith Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
mobile: +94 77 6602284, +94 71 3951048
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to