472,352 Members | 1,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Zipping Files to user defined Directory

Hi There.

I'm very new to python, and I have been using the TurboGears Framework
to use python to power my application.

I have a class which handles the upload of a file to a directory called
"uploads", which is hosted on a server.

my problems is that when I want to download that file from the server I
want to zip the files selected. but how does a user specify where they
want to save that file?.

I the user will be selecting the files they want to download and I want
to zip those files and let the user save it.

I want to know how to let the user specify where to save the zipped
files.

Any ideas?..any python to help me do this?? i know i can use the
zipfile module but I can't figure out the part about letting the user
decide.

Thank you

Stephen Sandhu

Jul 28 '06 #1
4 1365
In <11**********************@p79g2000cwp.googlegroups .com>,
OriginalBrownster wrote:
I'm very new to python, and I have been using the TurboGears Framework
to use python to power my application.

[…]

my problems is that when I want to download that file from the server I
want to zip the files selected. but how does a user specify where they
want to save that file?.
Usually the browser asks the user for a target directory. So that's not
your business.

After the user selected the files you have to zip them on the server, for
instance in a temporary in the `/tmp/` directory and then deliver that
archive to the user.

Ciao,
Marc 'BlackJack' Rintsch
Jul 28 '06 #2

Marc 'BlackJack' Rintsch wrote:
In <11**********************@p79g2000cwp.googlegroups .com>,
OriginalBrownster wrote:
I'm very new to python, and I have been using the TurboGears Framework
to use python to power my application.

[...]

my problems is that when I want to download that file from the server I
want to zip the files selected. but how does a user specify where they
want to save that file?.

Usually the browser asks the user for a target directory. So that's not
your business.

After the user selected the files you have to zip them on the server, for
instance in a temporary in the `/tmp/` directory and then deliver that
archive to the user.

Ciao,
Marc 'BlackJack' Rintsch

THanks Marc,

That makes sense. I can zip the files to a temp directory. However,
How do I deliver the archive to them?...

Jul 28 '06 #3

Marc 'BlackJack' Rintsch wrote:
In <11**********************@p79g2000cwp.googlegroups .com>,
OriginalBrownster wrote:
I'm very new to python, and I have been using the TurboGears Framework
to use python to power my application.

[...]

my problems is that when I want to download that file from the server I
want to zip the files selected. but how does a user specify where they
want to save that file?.

Usually the browser asks the user for a target directory. So that's not
your business.

After the user selected the files you have to zip them on the server, for
instance in a temporary in the `/tmp/` directory and then deliver that
archive to the user.

Ciao,
Marc 'BlackJack' Rintsch

THanks Marc,

That makes sense. I can zip the files to a temp directory. However,
How do I deliver the archive to them?...

Jul 28 '06 #4
Hi,

On Fri, 28 Jul 2006 05:25:38 -0700, OriginalBrownster wrote:
Marc 'BlackJack' Rintsch wrote:
>In <11**********************@p79g2000cwp.googlegroups .com>,
OriginalBrownster wrote:
[...]
>After the user selected the files you have to zip them on the server,
for instance in a temporary in the `/tmp/` directory and then deliver
that archive to the user.

Ciao,
Marc 'BlackJack' Rintsch


THanks Marc,

That makes sense. I can zip the files to a temp directory. However, How
do I deliver the archive to them?...
Like you deliver any other content in a cgi (assuming you are using a cgi):
By printing in on standard output.

I don't know "TurboGears" though.

cheers,
Danny
Sep 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Russell E. Owen | last post by:
I'm writing a cross-platform app. Presently it runs on unix and MacOS X, but eventually I'd like to get it working on Windows (nothing older than...
11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files...
0
by: Benjamin Bittner | last post by:
hallo ng, first of all, for the zipping progress i use the ziplib from http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx now to my...
1
by: RJN | last post by:
Hi Does .Net provide libraries for zipping files? I read that a third party component CSharplib is available for doing this. Is there any license...
6
by: reidarT | last post by:
I will develop a backup routine with local files (zipped) to an internet server via ftp. How do I zip files in Vb.net? reidarT
5
by: OriginalBrownster | last post by:
This will probably sound like a very dumb question. I am trying to zip some files within a directory. I want to zip all the files within a...
5
by: Jandre | last post by:
Hi I am a python novice and I am trying to write a python script (most of the code is borrowed) to Zip a directory containing some other...
2
by: Brian Vanderburg II | last post by:
I've installed Python 2.5 on MSW and it works. I'm preparing it to run from a thumb drive so I can run applications by dropping them onto the...
1
by: Bouzy | last post by:
I wrote this script... #!/usr/bin/python # Filename: backup_zip.py import os, zipfile, time, datetime, glob from os.path import splitext,...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.