Hi all,
Wondering how can I do the following in JSP/Servlets:
Upload a zip file (containing multiple CSV files)
Unzip the file to obtian the CSV files
Read the CSV files and pump the records into a mySQL database
Note: mySQL table is set up and ready for CSV files inputs.
Thanks in advance.
...
How do I decompress a compressed file in a rhomobile application?
I saw that the zlib extension is unavailable in rhodes, because it needs a ruby port. Ruby uses the "zlib.c" or "zlib.h" source files and not a portable zlib.
When running the rhodes application, in a line with the source:
require 'zlib'
it raises the error:
no such f...
Hi,
I am facing a problem where i need to convery the zipentry into a file.
What happens is that I have a zip file full of csv files. I need to unzip the file and extract out the csv files and read it using a Scanner() which takes in only a file (type) and not a zipentry...
...
hello,
i create one zip archive via php
and another zip archive via winrar, but from the same files.
size of two archives is different. the one via winrar is bigger (2 bytes).
why ? thanks.
OK NOW.
zip was created correctly using php.
problem was that i was sending it using
header('Content-Type: application/zip');
header('Content...
I want to extract a file from a zip to a specific path, ignoring the file path in the archive. This is very easy in Python 2.6 (my docstring is longer than the code)
import shutil
import zipfile
def extract_from_zip(name, dest_path, zip_file):
"""Similar to zipfile.ZipFile.extract but extracts the file given by name
from the zi...
Is there a consistent code-base that allows me to upload a zip file to both GAE and Tomcat-based servers, extract the contents (plain-text files), and process them?
...
I'm trying ZIP a bundle of File's and return ZIP through a servlet. This works fine if I just have one file but when I try to add more it seems they are just being appended to the first ZipEntry and thus the zip archive gets corrupted.
private void writeZipResponse(HttpServletResponse response,
List<File> bundle) {
try {
By...
What I actually wanted to do is read zip file and then if it does contain folder then refuse it with some message.
I want user should upload zip file with files only without any directory structure.
So I want to read zip file contains and check file structure.
I am trying with following code snippet.
$zip = zip_open('/path/to/zipfile'...
Hello all,
I am trying to use EC2 to zip up some files that are stored in an S3 bucket. I have gotten as far as successfully getting SWFUpload to work with PHP and upload the files to S3. I read that the best way to zip up S3 files without incurring huge transfer costs is to use EC2 to deal with S3. After a lot of effort I managed to ge...
Hello,
I have a folder full of zipped files (about 200). I would like to transform this into a folder consisting only of unzipped files. What would be the easiest and quickest way to do this?
Please note that I would like to remove the zipped file from the folder once it us unzipped.
Also, I'm on a Mac.
Thanks!
...
I have a large zip file, 4.3G. It contains about 100k entries.
I am reading it using Java 1.6.0_14 on Linux, Ubuntu 32 bit, and get the following exception.
java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1200(ZipFile.java:29)
...
Greetings,
I've taken over from a prior team and writing ETL jobs which process csv files. I use a combination of shell scripts and perl on ubuntu. The csv files are huge; they arrive as zipped archives. Unzipped, many are more than 30Gb - yes, that's a G
Legacy process is a batch job running on cron that unzips each file entirely, rea...
I have a zip file X and I'd like do extract a single file, located in x/x/x/file.txt. How do I do this using Archive::Zip and Perl?
...
i have a .zip file sitting on an IIS 6 webserver.
i have an html file with a link to that zip file like this:
<a href="file.zip">Download File</a>
When you open the page and click the link in firefox or chrome, you get the Open or Save dialog box as expected.
When you do the same in Internet Explorer 8, you navigate to a new page th...
I'm using the following winrar command line to create zip archives
rar.exe a -df -ep -ag[yyyyMMddhhmmss] -ms[txt] C:\MyZipFile.zip C:\tmp\MyFiles*.txt
The archives created are in RAR format instead of ZIP.
Is there a way to create regular ZIP and not RAR archives?
...
What should be the return type of a zip function? (zip as in most other languages, e.g. read here)
I thought about some Pair-type but that does not exist in Java. It is often states that this is because a specialized Pair-class is better than a general one (see this question). However, this is not possible in a general zip function.
...
Hi all,
I have to replace variables inside a user-submitted xlsx file and am doing it this way:
Rename the .xlsx to .zip
Unzip to a temp-folder
Make the necessary changes
Zip the files
Rename the .zip to .xslx
I am using plain ZipArchive in PHP. When I try to open the generated .xlsx in Excel, it fails with a message format or exten...
I am currently doing this:
<jar update="yes"
jarfile="${pwd}/dist/${release}_installer.jar">
<zipfileset src="${pwd}/dist/app.jar" includes="com/izforge/izpack/panels/**"/>
<zipfileset src="${pwd}/dist/app.jar" includes="com/xyz/img/logo.png"/>
</jar>
My existing installer JAR gets updated to include the file...
I'm wondering if someone has a script to zip all the files in a folder and it's sub-folders while maintaining the original filenames? So basically for every file within the folder, I would want a corresponding zip file created. I've never used VBScript before so I'm not sure how this can be done and would take a me quite a while to figur...
All discussion is about python 3.1.2; see Python docs for the source of my question.
I know what zip does; I just don't understand why it can be implemented like this:
def zip(*iterables):
# zip('ABCD', 'xy') --> Ax By
iterables = map(iter, iterables)
while iterables:
yield tuple(map(next, iterables))
Let's say I ...