Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP and Plesk - ActiveX unzip component

Posted on 2013-11-11
6
Medium Priority
?
566 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 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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 53

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 53

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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

721 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