471,595 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Gallery app with Zip file upload

mc
I'm creating a gallery app, I would like users to be able to upload a
zip file (containing images) which I then unpack and and store in a
gallery for online review.

Do I need a third party component or can it be done in c# alone?

TIA

MC
Nov 21 '06 #1
11 1607
"mc" <mc@community.nospamwrote in message
news:45********@mail.hmgcc.gov.uk...
I'm creating a gallery app, I would like users to be able to upload a zip
file (containing images) which I then unpack and and store in a gallery
for online review.

Do I need a third party component or can it be done in c# alone?
http://blogs.msdn.com/dotnetinterop/...05/567402.aspx

Personally, I don't like the System.IO.Compression stuff much, so I tend to
use the Chilkat Zip add-in: http://www.chilkatsoft.com/Zip-DotNet.asp
Nov 21 '06 #2
SharpZipLib http://icsharpcode.net/OpenSource/Sh...b/Default.aspx
could be what you are looking for at the pricely cost of 0$

On Tue, 21 Nov 2006 17:20:33 +0000, mc <mc@community.nospamwrote:
>I'm creating a gallery app, I would like users to be able to upload a
zip file (containing images) which I then unpack and and store in a
gallery for online review.

Do I need a third party component or can it be done in c# alone?

TIA

MC
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 21 '06 #3

You cannot do it in C# alone because the System.IO.Compression namespace
doesn't support the multiple file with zipheader zip format (like Winzip) -
only Gzip.

However, you can get the free ICSharpCode.SharpZipLib library which is 100%
C#, and that will handle zip files very nicely.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"mc" wrote:
I'm creating a gallery app, I would like users to be able to upload a
zip file (containing images) which I then unpack and and store in a
gallery for online review.

Do I need a third party component or can it be done in c# alone?

TIA

MC
Nov 21 '06 #4
mc
I probably should have said in my initial post, the "Live" site will be
run from a shared server, so I'd like to avoid third party components if
possible!

Rad [Visual C# MVP] wrote:
SharpZipLib http://icsharpcode.net/OpenSource/Sh...b/Default.aspx
could be what you are looking for at the pricely cost of 0$

On Tue, 21 Nov 2006 17:20:33 +0000, mc <mc@community.nospamwrote:

>>I'm creating a gallery app, I would like users to be able to upload a
zip file (containing images) which I then unpack and and store in a
gallery for online review.

Do I need a third party component or can it be done in c# alone?

TIA

MC

--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 21 '06 #5
I very much doubt using SharpZipLib will be a problem. It will just be
a DLL you reference in your application and deploy using plain old
ftp.

Besides, you also get the source code so you can include that in your
application if your objective is to get a single DLL.

On Tue, 21 Nov 2006 20:00:15 +0000, mc <mc@community.nospamwrote:
>I probably should have said in my initial post, the "Live" site will be
run from a shared server, so I'd like to avoid third party components if
possible!

Rad [Visual C# MVP] wrote:
>SharpZipLib http://icsharpcode.net/OpenSource/Sh...b/Default.aspx
could be what you are looking for at the pricely cost of 0$

On Tue, 21 Nov 2006 17:20:33 +0000, mc <mc@community.nospamwrote:

>>>I'm creating a gallery app, I would like users to be able to upload a
zip file (containing images) which I then unpack and and store in a
gallery for online review.

Do I need a third party component or can it be done in c# alone?

TIA

MC

--

Bits.Bytes.
http://bytes.thinkersroom.com
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 21 '06 #6
Hello MC,

I agree that for your scenario, the ShareZipLib will be more appropriate
since it supports many other zip formats. The compression component in .net
framework 2.0 only support Gzip format currently, and for your scenario
since the user may create the zip attachment through other software that
product zip package other than gzip one, use the built-in one will not
work.

Also, as you mentioned that the application will be hosted on a shared
server, is your concern here that 3rd party component will need to be
install in GAC? If so, by default the sharpziplib component is
strong-named which should be put into GAC, however, since its source code
is available, you can consider compile it as a private assembly and simply
deploy it within private "bin" folder.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '06 #7
mc
Ok, I'll have a look.

Thanks
mc

Rad [Visual C# MVP] wrote:
I very much doubt using SharpZipLib will be a problem. It will just be
a DLL you reference in your application and deploy using plain old
ftp.

Besides, you also get the source code so you can include that in your
application if your objective is to get a single DLL.

On Tue, 21 Nov 2006 20:00:15 +0000, mc <mc@community.nospamwrote:

>>I probably should have said in my initial post, the "Live" site will be
run from a shared server, so I'd like to avoid third party components if
possible!

Rad [Visual C# MVP] wrote:
>>>SharpZipLib http://icsharpcode.net/OpenSource/Sh...b/Default.aspx
could be what you are looking for at the pricely cost of 0$

On Tue, 21 Nov 2006 17:20:33 +0000, mc <mc@community.nospamwrote:

I'm creating a gallery app, I would like users to be able to upload a
zip file (containing images) which I then unpack and and store in a
gallery for online review.

Do I need a third party component or can it be done in c# alone?

TIA

MC

--

Bits.Bytes.
http://bytes.thinkersroom.com

--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 22 '06 #8
mc
Refreshingly simple to use, very useful library!

I did however have to recompile and add the Allow partially trusted
callers (APTCA) attribute to get it working on my host, who has just
tightened there security restrictions. which they say is in response to
a security hole identified by MS?

Thanks All
MC

mc wrote:
Ok, I'll have a look.

Thanks
mc

Rad [Visual C# MVP] wrote:
>I very much doubt using SharpZipLib will be a problem. It will just be
a DLL you reference in your application and deploy using plain old
ftp.

Besides, you also get the source code so you can include that in your
application if your objective is to get a single DLL.

On Tue, 21 Nov 2006 20:00:15 +0000, mc <mc@community.nospamwrote:

>>I probably should have said in my initial post, the "Live" site will
be run from a shared server, so I'd like to avoid third party
components if possible!

Rad [Visual C# MVP] wrote:

SharpZipLib http://icsharpcode.net/OpenSource/Sh...b/Default.aspx
could be what you are looking for at the pricely cost of 0$

On Tue, 21 Nov 2006 17:20:33 +0000, mc <mc@community.nospamwrote:

I'm creating a gallery app, I would like users to be able to upload
a zip file (containing images) which I then unpack and and store in
a gallery for online review.
>
Do I need a third party component or can it be done in c# alone?
>
TIA
>
MC
--

Bits.Bytes.
http://bytes.thinkersroom.com


--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 27 '06 #9
Hello MC,

What is security hole you mentioned? For the APTCA attribute, if your
ASP.NET application is configured to partial trust level, making your
assembly APTCA is necessary. Also, some assembly may demand some CAS
permissions that are not grant in partial trust level policy(such as medium
or low trust level), you need to take care of this if you meet such cases.

Here are some msdn articles about using partial trust CAS in ASP.NET 2.0:

http://msdn.microsoft.com/library/de...us/dnpag2/html
/paght000020.asp

http://msdn.microsoft.com/library/en...7.asp?frame=tr
ue
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 28 '06 #10
mc
Not being a security expert or Microsoft person I can only go on the
information released by Brinkster (My Shared Web host) They tell me that
They where informed by Microsoft of a security hole in IIS which when
the trust level was too high a tech savvy user could gain access to
other users sites, The MS solution was to apply a patch and then set the
trust levels appropriately. this, I've been told by my host is that any
external Assemblys require th APTCA and That we no-longer have access to
things like the registry or event logs (Which I've no use for).

To get my .NET 2.0 site to work all I need to do is re-publish it with
string named Assemblys and specified the APTCA attribute. after doing
this all was fine.

Once I'd recompiled the SharpZipLib assembly with APTCA it also worked fine.

MC

Steven Cheng[MSFT] wrote:
Hello MC,

What is security hole you mentioned? For the APTCA attribute, if your
ASP.NET application is configured to partial trust level, making your
assembly APTCA is necessary. Also, some assembly may demand some CAS
permissions that are not grant in partial trust level policy(such as medium
or low trust level), you need to take care of this if you meet such cases.

Here are some msdn articles about using partial trust CAS in ASP.NET 2.0:

http://msdn.microsoft.com/library/de...us/dnpag2/html
/paght000020.asp

http://msdn.microsoft.com/library/en...7.asp?frame=tr
ue
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Nov 28 '06 #11
Thanks for your reply MC,

Yes, when configured as partial trust, external assemblies are required to
mark as APTCA. Also, if the appliation do need any particular CAS
permissions, we need to configure them in the security policy.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 29 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by matt | last post: by
2 posts views Thread by Martin Brunner | last post: by
5 posts views Thread by bob garbados | last post: by
3 posts views Thread by bob garbados | last post: by
4 posts views Thread by saunders1989 | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

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.