467,858 Members | 1,725 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,858 developers. It's quick & easy.

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
  • viewed: 1270
Share:
4 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Russell E. Owen | last post: by
11 posts views Thread by Steven T. Hatton | last post: by
reply views Thread by Benjamin Bittner | last post: by
1 post views Thread by RJN | last post: by
6 posts views Thread by reidarT | last post: by
5 posts views Thread by OriginalBrownster | last post: by
5 posts views Thread by Jandre | last post: by
2 posts views Thread by Brian Vanderburg II | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.