<div dir="ltr">yes jamie, is same folder .<div>so my folder is </div><div><span style="font-family:arial,sans-serif;font-size:13px">/sites/</span><a href="http://samplesite.com/files/newsletters/" target="_blank" style="font-family:arial,sans-serif;font-size:13px">samplesite.com/files/newsletters/</a><br>
</div><div><br></div><div>and permission is </div><div><span style="font-family:arial,sans-serif;font-size:13px">drwxrwxrwx 2 ubuntu ubuntu 4096 Jan 28 03:18 newsletters</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">but still i get the error </span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">"</span>Warning:
ZipArchive::extractTo(): Permission denied in ArchiverZip->extract()
(line 112 of <a href="http://samplesite.com/modules/system/system.archiver.inc">samplesite.com/modules/system/system.archiver.inc</a>)"</div><div><br></div><div>I tried with www-data as owner user for above directory(<a href="http://stackoverflow.com/questions/12446583/php-warning-ziparchiveextractto-permission-denied">http://stackoverflow.com/questions/12446583/php-warning-ziparchiveextractto-permission-denied</a>), but still it wont work. it shows same error, as permission denied.</div>
<div><br></div><div>Please if u have any idea, help me in this.</div><div><br></div><div><br></div><div>thanks a lot for your help so far.</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 11:55 AM, Jamie Holly <span dir="ltr"><<a 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>You showed the permissions for
files/test. Is that folder the same?<span class="HOEnZb"><font color="#888888"><br>
<pre cols="72">Jamie Holly
<a href="http://hollyit.net" target="_blank">http://hollyit.net</a></pre></font></span><div><div class="h5">
On 1/27/2014 10:43 PM, Swatee Karpe wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">/sites/<a href="http://samplesite.com/files/newsletters/" target="_blank">samplesite.com/files/newsletters/</a><br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, Jan 28, 2014 at 11:35 AM, Jamie
Holly <span dir="ltr"><<a 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's the path your are sending to extract to?<span><font color="#888888"><br>
<pre cols="72">Jamie Holly
<a href="http://hollyit.net" target="_blank">http://hollyit.net</a></pre>
</font></span>
<div>
<div> On 1/27/2014 10:25 PM, Swatee Karpe
wrote:<br>
</div>
</div>
</div>
<div>
<div>
<blockquote type="cite">
<div dir="ltr">Jamie,
<div><br>
</div>
<div>Now I can see Warning:
ZipArchive::extractTo(): Permission denied in
ArchiverZip->extract() (line 112 of
/examplesite/modules/system/system.archiver.inc)
error.</div>
<div><br>
</div>
<div>My files/test have following permission</div>
<div><br>
</div>
<div>drwxrwxrwx 2 ubuntu ubuntu 4096 Jan 28
03:18 test<br>
</div>
<div><br>
</div>
<div>I cant understand why this error occur.</div>
<div><br>
</div>
<div>Any idea on this?</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote"> On Tue, Jan 28, 2014 at
11:15 AM, Swatee Karpe <span dir="ltr"><<a href="mailto:swateekarpe@gmail.com" target="_blank">swateekarpe@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">$file = public://archive.zip.
like this.<br>
</div>
<div>
<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 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 href="http://samplesite.com/files/testjan.zip" target="_blank">samplesite.com/files/testjan.zip</a><span><font color="#888888"><br>
<pre cols="72">Jamie Holly
<a href="http://hollyit.net" target="_blank">http://hollyit.net</a></pre>
</font></span>
<div>
<div> On 1/27/2014 9:54 PM,
Swatee Karpe wrote:<br>
</div>
</div>
</div>
<div>
<div>
<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 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 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 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 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 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 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>
</div>
</div>
</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 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 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>