Hi Rajith,

Thank you for the explanation. The given solution worked !

It seems zip4j by default locate files relative to server_home.

Thanks!


On Tue, Jul 29, 2014 at 3:28 PM, Rajith Vitharana <[email protected]> wrote:

> Hi Buddhima,
>
> As I have pointed out earlier you can take the server home folder using
> "require('process').getProperty('carbon.home')"
> Using this you can save your zip file to a location of your choice
> then using Zip4j lib in [1] you can extract the content of the zip file to
> any location where you need
> for that copy the "Zip4j.jar" file to
> "SERVER_HOME/repository/component/lib" folder and restart the server
> then use below code in jaggery to extract your zip file
>
> var zipFile = new
> net.lingala.zip4j.core.ZipFile("/wso2ues-1.5.0/hello/ddd.zip");
> zipFile.extractAll("/wso2ues-1.5.0/hello/unzip");
>
> Thanks,
>
>
> [1] - http://www.lingala.net/zip4j/download.php
>
>
> On Tue, Jul 29, 2014 at 2:43 PM, Buddhima Wijeweera <[email protected]>
> wrote:
>
>> Hi,
>>
>> Currently I have developed a Jaggery app which is running on Jaggery
>> server. I was also able to send POST request containing a zip file to that
>> app.
>>
>> So what I need is ; that Jaggery app to extract that uploaded zip file,
>> and put its content in to a folder.
>>
>> Hope this will make my question more clear.
>>
>> Thank You!
>>
>>
>> On Tue, Jul 29, 2014 at 2:36 PM, Dilan Udara Ariyaratne <[email protected]>
>> wrote:
>>
>>> Hi Buddhima,
>>>
>>> Once you have created your jaggery app (let's name the containing folder
>>> as <your-jaggery-app-root-folder>), select all the files and folders inside
>>> <your-jaggery-app-root-folder>
>>> and compress the files into a .zip file which you can upload to the
>>> Application server under this path:
>>> Home > Manage > Applications > Add > Jaggery
>>>
>>> If you are simply using the jaggery server to get this done, copy
>>> <your-jaggery-app-root-folder> with its content to <jaggery-server>/apps
>>> and start the server.
>>> Now, you should be able to access your application using the following
>>> url:
>>> http://localhost:9763/<your-jaggery-app-roo-folder> by default.
>>>
>>> Cheers...
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *Dilan U. Ariyaratne*
>>> Software Engineer
>>> WSO2 Inc. <http://wso2.com/>
>>> Mobile: +94775149066
>>> lean . enterprise . middleware
>>>
>>>
>>> On Tue, Jul 29, 2014 at 2:17 PM, Udara Rathnayake <[email protected]>
>>> wrote:
>>>
>>>> Hi Buddhima,
>>>>
>>>> If you upload a zip file to any location within
>>>> <JAGGERY_SERVER>/repository/deployment/server/jaggeryapps/ , server will
>>>> treat that file as a webapp and unzip it for you.
>>>>
>>>> You can try this behavior by copying a zip file to a directory inside
>>>> your webapp. But I'm not sure whether this behaviour is correct or not.
>>>> File API[1] might help you further.
>>>>
>>>> [1] http://jaggeryjs.org/documentation.jag?api=file
>>>>
>>>> Regards,
>>>> UdaraR
>>>>
>>>>
>>>> On Tue, Jul 29, 2014 at 2:05 PM, Buddhima Wijeweera <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm currently developing a Jaggery app, which user can upload a zip
>>>>> file. After uploading the zip file, Jaggery app should extract that zip
>>>>> file & put the content in to a folder (at server-side).
>>>>>
>>>>> So I would like to know how can I do this or is there any place where
>>>>> this is already implemented.
>>>>>
>>>>> Thank You!
>>>>>
>>>>> --
>>>>> Buddhima Wijeweera
>>>>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>>>>
>>>>> Email: [email protected]
>>>>> Blog:   https://buddhimawijeweera.wordpress.com
>>>>> GitHub Profile: https://github.com/Buddhima
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Udara Rathnayake*
>>>> Software Engineer
>>>> WSO2 Inc. : http://wso2.com
>>>>
>>>> Mobile : +94 772207239
>>>> Twitter : http://twitter.com/udarakr
>>>> Blog    : http://udarakr.blogspot.com
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>
>>
>> --
>> Buddhima Wijeweera
>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>
>> Email: [email protected]
>> Blog:   https://buddhimawijeweera.wordpress.com
>> GitHub Profile: https://github.com/Buddhima
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Rajith Vitharana
>
> Software Engineer,
> WSO2 Inc. : wso2.com
> Mobile : +94715883223
> Blog : http://lankavitharana.blogspot.com/
>



-- 
Buddhima Wijeweera
Software Engineer; WSO2 Inc.; http://wso2.com ,

Email: [email protected]
Blog:   https://buddhimawijeweera.wordpress.com
GitHub Profile: https://github.com/Buddhima
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to