Solved

ASP and Plesk - ActiveX unzip component

Posted on 2013-11-11
6
557 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 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 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Web Development 6 68
How do I Import CSV File In my PHP Application 29 74
RestClient.cs fails at (HttpWebResponse)request.GetResponse()) 4 51
PHP, Curl and XML 13 13
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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