<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Run drupal_realpath on that and it will
be fine:<br>
<br>
$file=drupal_realpath('public://archive.zip');<br>
<br>
<br>
<pre class="moz-signature" cols="72">Jamie Holly
<a class="moz-txt-link-freetext" href="http://hollyit.net">http://hollyit.net</a></pre>
On 1/27/2014 10:15 PM, Swatee Karpe wrote:<br>
</div>
<blockquote
cite="mid:CA+DP+qStywEgRnuQ8mnM4VzTERNqEGFTEHMxr0u3Zd_k1LBM3w@mail.gmail.com"
type="cite">
<div dir="ltr">$file = public://archive.zip. like this.<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, Jan 28, 2014 at 11:08 AM, Jamie
Holly <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:hovercrafter@earthlink.net" target="_blank">hovercrafter@earthlink.net</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>What are you using to set the $file variable? It
needs to be a path to the local file system. What you
got is a URL. You want something more along the lines of
/sites/<a moz-do-not-send="true"
href="http://samplesite.com/files/testjan.zip"
target="_blank">samplesite.com/files/testjan.zip</a><span
class="HOEnZb"><font color="#888888"><br>
<pre cols="72">Jamie Holly
<a moz-do-not-send="true" href="http://hollyit.net" target="_blank">http://hollyit.net</a></pre>
</font></span>
<div>
<div class="h5"> On 1/27/2014 9:54 PM, Swatee Karpe
wrote:<br>
</div>
</div>
</div>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">Thanks for replying Jamie.
<div><br>
</div>
<div>I tried to use $archiver =
archiver_get_archiver($file);</div>
<div><br>
</div>
<div>It shows <em>Exception</em>: Archivers can
only operate on local files: <em
class="placeholder"><a moz-do-not-send="true"
href="http://samplesite.com/sites/samplesite.com/files/testjan.zip"
target="_blank">http://samplesite.com/sites/samplesite.com/files/testjan.zip</a></em>
not supported in <em>archiver_get_archiver()</em>
(line <em>8091</em> of <em>/sites/drupal7/includes/common.inc</em>).</div>
<div>Error to me.</div>
<div><br>
</div>
<div>Any solution on this?</div>
<div><br>
</div>
<div>do u have sample code for this?<br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Jan 27, 2014 at
10:02 PM, Jamie Holly <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:hovercrafter@earthlink.net"
target="_blank">hovercrafter@earthlink.net</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>If you're using Drupal 7, it would be
better to use the built in archiver class.
It's used in
update_manager_archive_extract in
modules/update/update.manager.inc:<br>
<br>
<a moz-do-not-send="true"
href="https://api.drupal.org/api/drupal/modules%21update%21update.manager.inc/function/update_manager_archive_extract/7"
target="_blank">https://api.drupal.org/api/drupal/modules%21update%21update.manager.inc/function/update_manager_archive_extract/7</a><span><font
color="#888888"><br>
<br>
<br>
<pre cols="72">Jamie Holly
<a moz-do-not-send="true" href="http://hollyit.net" target="_blank">http://hollyit.net</a></pre>
</font></span>
<div>
<div> On 1/27/2014 2:20 AM, Swatee Karpe
wrote:<br>
</div>
</div>
</div>
<div>
<div>
<blockquote type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I am using drupal 7 and I want
extract the zip file and save the
extracted folder into files
directory. I am taking zip file
from one of my content type.</div>
<div><br>
</div>
<div>For this I am trying to use
ZipArchive class. </div>
<pre><span style="font-family:arial"> $zip = new ZipArchive;</span>
</pre>
<div>
<div> $unzip =
$zip->open($filename);</div>
<div><br>
</div>
<div>
<pre>ZipArchive Object
(
[status] => 0
[statusSys] => 0
[numFiles] => 0
[filename] =>
[comment] => </pre>
<div>)</div>
</div>
<div><br>
</div>
<div>After printing $zip i get the
empty array as above.<br>
</div>
<div><br>
</div>
<div>Do any one know why this is
not working in my case?</div>
<div>Or any one know other way to
extract file and save it to
folder.</div>
<div><br>
</div>
<div>Thanks in advance.</div>
<div>--</div>
<div dir="ltr">Swatee Amit Karpe<br>
<br>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</blockquote>
<br>
</div>
</div>
</div>
<br>
--<br>
[ Drupal support list | <a
moz-do-not-send="true"
href="http://lists.drupal.org/"
target="_blank">http://lists.drupal.org/</a>
]<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">Thanks & Regards,<br>
Swatee Amit Karpe<br>
<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</blockquote>
<br>
</div>
</div>
</div>
<br>
--<br>
[ Drupal support list | <a moz-do-not-send="true"
href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">Thanks & Regards,<br>
Swatee Amit Karpe<br>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>