Solved

ASP and Plesk - ActiveX unzip component

Posted on 2013-11-11
6
546 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
  • 3
  • 2
6 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Back in July, I blogged about how Microsoft's new server pricing model, combined with the end of the Small Business Server package, would result in significant cost increases for many small businesses (see SBS End of Life: Microsoft Punishes Small B…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now