login about faq

The OpenFromWeb method does not exist in Chilkat v9.5.0. Is it possible to open a .zip from a URL?

asked Apr 07 '14 at 13:18

chilkat's gravatar image

chilkat ♦♦
11.8k316358420


The OpenFromWeb method was removed from the Chilkat.Zip API because it created dependencies w/ too much internal infrastructure (extra baggage) relating to HTTP, SSL/TLS, and everything network, socket, encryption, and PKCS related, which is quite a large amount of internal code. The removal is necessary for many situations where smaller link sizes are important. To workaround, one would need to first download the .zip into memory or to a file, and then open.

Here is an example in Visual Basic 6.0 using the Chilkat ActiveX to download first into memory, and then open from memory. (The OpenFromWeb method downloaded the entire .zip into memory prior to opening anyway.)

Private Sub OpenFromWeb_Click()

Dim Http As ChilkatHttp
Set Http = New ChilkatHttp

Dim Zip As ChilkatZip
Set Zip = New ChilkatZip

Dim success As Long
success = Http.UnlockComponent("30-day trial")
If (success <> 1) Then
    Text1.Text = Text1.Text & Http.LastErrorText & vbCrLf
    Exit Sub
End If
success = Zip.UnlockComponent("30-day trial")
If (success <> 1) Then
    Text1.Text = Text1.Text & Zip.LastErrorText & vbCrLf
    Exit Sub
End If

' First download the zip into memory:
Dim zipFileInMemory() As Byte
zipFileInMemory = Http.QuickGet("http://www.chilkatsoft.com/download/chilkat-9.5.0-jdk8-win32.zip")
If (Http.LastStatus = 404) Or (UBound(zipFileInMemory) = 0) Then
    Text1.Text = Text1.Text & Http.LastErrorText & vbCrLf
    Exit Sub
End If

' Now open it from memory. success = Zip.OpenFromMemory(zipFileInMemory) If (success <> 1) Then Text1.Text = Text1.Text & Zip.LastErrorText & vbCrLf Exit Sub End If

MsgBox "Num zip entries: " + Str(Zip.NumEntries)

End Sub

link

answered Apr 07 '14 at 13:22

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×87
×1

Asked: Apr 07 '14 at 13:18

Seen: 816 times

Last updated: Apr 07 '14 at 13:22

powered by OSQA