We help IT Professionals succeed at work.
Get Started

vb.net zip help needed

516 Views
Last Modified: 2012-08-14
I am trying to extract, zip and download.  I have an open question on this.  However, I have finaly gotten to a point where I can get most of the work done, for zip part after searching number of ways, I found I can do cmd.exe shell to use zip.  I do not know much about it.  There is a site for zip 3.0 with open source code.  In any case, I get the zip to work on the server that I am developing on.  However that is using hardcoded drive/folder locations.  When I move to production it does not work.  I do not know if I can and how to use virtual path on the cmd.exe and/or zip command.  I have sample command below that works on developer machine.  can anyone help me make this code work on production server, basically point me in direction where I can switch this to virtual path.
Thanks


=====================================================
'I need server.MapPath or some similar command below I believe, not sure what is proper format...
Dim zipcmd As String = "zip -q -r -j C:\abc\SQLRESULTS\SQLRESULTS.zip C:\abc\SQLRESULTS"
Shell("cmd.exe /c /k cd C:\abc\SQLRESULTS\" + zipcmd, AppWinStyle.Hide, True)

'below code works fine;
Response.ContentType = "application/x-zip-compressed"
Response.AppendHeader("Content-Disposition", "attachment; filename=abc.zip")
Response.TransmitFile(Server.MapPath("~/SQLRESULTS/SQLRESULTSxxx.zip"))
Response.End()
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE