1

I'm using this code to zip a folder

 D:\VIRTUAL\consuladoperurio.com.br\WWW\siscons\test\wordtemplatedownload\pasta 

into test.zip. The folder "pasta" has the follow tree

pasta
    subfolder
        styles.xml

When I run the code

$wordtemplatedownloadpath ="D:\\VIRTUAL\\consuladoperurio.com.br\\WWW\\siscons\\test\\wordtemplatedownload\\"
Zip($wordtemplatedownloadpath."pasta", $wordtemplatedownloadpath."test.zip");

and then extract test.zip I get the folder and file

enter image description here respectively. When I need the first tree.

I'm trying to replace '/' to '\' but don't work. How I will be able to solve that?

Community
  • 1
  • 1
Juan
  • 2,073
  • 3
  • 22
  • 37

1 Answers1

1

I will concentrate on your last question "I'm trying to replace '/' to '\' but don't work. How I will be able to solve that?" as at the moment it is unclear what you are asking about.

But if you are having problems specifying a path to your directory try to use the constant DIRECTORY_SEPARATOR within your path definition

Example

$wordtemplatedownloadpath ="D:" . DIRECTORY_SEPARATOR . "VIRTUAL" . DIRECTORY_SEPARATOR . "consuladoperurio.com.br" . DIRECTORY_SEPARATOR . "WWW" . DIRECTORY_SEPARATOR . "siscons" . DIRECTORY_SEPARATOR . "test" . DIRECTORY_SEPARATOR . "wordtemplatedownload" . DIRECTORY_SEPARATOR ;

Please let me know if this fixes your problem

Bizmate
  • 1,835
  • 1
  • 15
  • 19