Solved

ASP and Plesk - ActiveX unzip component

Posted on 2013-11-11
6
555 Views
Last Modified: 2013-11-14
Hi All:

I'm trying to move my ASP-scripted website to a new host (GoDaddy) and their support has been less than stellar.  I need to know how to access an ActiveX component that would allow a .zip to be unzipped on the server.

On my old host, the object is accessed as such:
    Set objZip = Server.CreateObject("XStandard.Zip")

No one seems to know what the name of this component, if any, would be on Plesk.  The also offer Window Shared Hosting, but they couldn't answer for that one either.  I get a vague response suggesting that they don't cover coding and to use whatever the "default" object is on ASP in general.

I'm frankly about to try a different web host, so I suppose anyone's recommendation for good webhosting would be a good addendum to this question.
0
Comment
Question by:RustyRazor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39640016
That dll is not one of their components installed.  See http://support.godaddy.com/help/article/5614/which-components-does-my-hosting-support

You would either need to be on a vps or dedicated server to install custom dll's.  Your answer is it can't be done without installing the dll and there are not going to be any shared hosting providers that will install a dll for one person.  

The easy workaround would be to create a stand alone php page that simply has a function that can unzip a file then save to the server.   http://php.net/manual/en/ziparchive.extractto.php.   You can create a function very similar to asp where you can submit via post the file information and perhaps some type of secret pass key.
0
 

Author Comment

by:RustyRazor
ID: 39646663
I like your workaround and it seems reasonable.

I've been trying a standard script:

<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
    $zip->extractTo('/my/unarchive/dir/');
    $zip->close();
    echo 'ok';
} else {
    echo 'failed';
}
?>

Open in new window


It seems to be crashing on the extractTo line.  

I also seem to be having trouble with pathing.  for exmaple, if I specifiy /my/unarchive/dir/test.zip as the open file, the file is not found, so I had to copy the .zip file to the root directory to skip that error.  

Any thoughts?  Would there be any server-side settings I need to be aware of?  Of course the subdiectory in question has read/write permissions.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39646794
I really am not very versed in PHP.  If you look down a little in that link you will see a note about  using windows where you have to account for the back slash. See if this works.

Make attention when using this function with apache & windows system. Windows file system use \  (backslash) instead of unix / (slash) 
Use str_replace like this. 
<?php 
$zip = new ZipArchive; 
    if ($zip->open("file.zip")){ 
        $path = getcwd() . "/dirToextract/"; 
        $path = str_replace("\\","/",$path); 
        echo $path; 
        echo $zip->extractTo($path); 
        $zip->close(); 
        echo 'Done.'; 
    } else { 
        echo "Error"; 
    } 
?>

Open in new window

0
 

Author Comment

by:RustyRazor
ID: 39648029
padas:

I accept the PHP script idea as the solution and I'll close this question out, but the code segment is generating a syntax error on the extractTo statement.  I'll open a new question.  Thanks.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39648062
Sounds good. Just make sure you start with the topic for PHP.

http://www.experts-exchange.com/Microsoft/Development/Q_28294099.html
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question