How can get the actual file from the zipped file? - java

I am returning a Zipped file say My_File.txt.zip from the My server side using JAX-RS (Jersey). My server-side is Java.
So I am getting the My_File.txt.zip in the client side while downloading.
But I want the actual file My_File.txt while downloading in the browser.
Is it possible?
I am working with Glassfish 3.x. So I there any configuration on Glassfish to do this?
Or can i change the configuration in Firefox (or other browsers) to do this?
Please suggest me the correct answer.
Thanks in advance.

Related

Client based solution for upload entire folders to an Servlet

Im currently writing a web application, where a user should be able to select an folder and upload all of its content to an servlet.
The idea is, that a user can select a folder, the folder and its content will be sent due a post request to the servlet. The servlet takes them, parses the structure and saves the structure in a database. (Filenames , foldernames..etc) (Thats also why, i cannot pass the files directly to the ftp server).
Afterward the servlets connects to an FTP Server, where the files will be stored permanently.
The Web Application uses JavaEE (Apache Tomcat 7.0, Servlet 3.0 API)
Currently Im using JUpload to achieve this, but in fact I've read that it is highly advised against using Java Applets, because of security issues. Also JUpload is not intended to use with Servlet 3.0 API, but with a little hack it works.
A normal input file form is not sufficient for this need.
Now I'm wondering, because i didnt find any other solution, which can achieve this. I've heard about some Flash Solutions, but im not familiar with flash. And also Flash has some security issues, like Applets.
Is there any other solution to solve this ?

Enable JSON response in Axis2

I've deployed Axis2 on a tomcat7 web server (linux machine).
To achieve this situation I copy the axis2.war into my /usr/share/tomcat7/webapps directory.
Then from my tomcat "localhostPath:8080/manager/html" I deploy the axis2.war just copied.
So browsing "localhostPath:8080/axis2/" I'm able to add a .aar service file which I wrote for axis2.
My service works well. All perfect! Service responses are in SOAP messages.
Now how can I have a JSON response from my service. I can't follow http://axis.apache.org/axis2/java/core/docs/json_support.html because axis2.xml is inside my axis2.war file and it is not possible to edit it.
Can someone help me? thanks a lot
Massimo
To get responses in JSON message fromat, you need to enable the message fromatter. For that you have to edit axis2.xml.
You might need to create the war again and deploy in the tomcat.

Uploading a file from applet to server

I have an applet which records sound. This applet is integrated in VAADIN application using AppletIntegration addon. The applet runs just fine. Now, I have to upload that recorded file to my server, on which the vaadin app is running. How could I do that. Any solution , any ideas ?
Thanks.
Emm...
You can use HttpComponents its HttpClient + FileUpload libs combination;
For more detailed information you can read this and this examples
P.S.
Please report if that helps
Good luck

Uploading and Downloading files using GWT

Is there a way to upload and download files to a svn server using GWT? I have had no luck so far and any help would be greatly appreciated
You can do that in the server side whit some 3'rd party library's like SVNKit
then you can get some information (Transfer over the wire whit something like RPC) and show in GWT client side

upload files directly from local folder, using browser

i have to upload large number of files to server, directly from my pc, using only web browser.
which is best way to achieve that?
do i need some java applet, or is it possible to achieve woth php/jquery?
will it be unsecure if i try with php script that works with ftp connection?
thank you in advance!
There's various ready-made plugins on doing file upload on jquery.
Doing this kind of uploading hacks is not an enjoyable experience, so people enjoy using ready-made solutions.
Here's few:
Ajax File Upload Plugin
Multiple File Upload Plugin
jQuery forms plugin this posts your files through an iframe to get the effect :
you can also try this
You can search more from jquery's plugin -site.
If your only web browser is mozilla firefox, then try fireftp addon plugin, it works similarly as normal FTP app.

Categories