# Caminho para diretório

**URL:** <https://forum.infinityfree.com/t/caminho-para-diretorio/85471>\
**Category:** Hosting Support\
**Created:** [October 31, 2023, 6:50pm UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471 "2023-10-31T18:50:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PedroBarbosapqv](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/pedrobarbosapqv/32/41195_2.png) [@PedroBarbosapqv](https://forum.infinityfree.com/u/PedroBarbosapqv)\
**Post date:** [October 31, 2023, 6:50pm UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/1 "2023-10-31T18:50:19Z")

</div>

o diretório do infiity aceita caminhos relativos? estou tentanto mover arquivos entre pastas e não consigo por conta do caminho.

TRANSLATED BY MOD

Does the infiity directory accept relative paths? I’m trying to move files between folders and I can’t because of the path.

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [October 31, 2023, 7:54pm UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/2 "2023-10-31T19:54:22Z")

</div>

Welcome!

Perhaps something got lost in translation, but I don’t quite understand what you are trying to do. You can use relative paths in your PHP code, yes.

---

<div class="post-metadata">

**Author:** ![PedroBarbosapqv](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/pedrobarbosapqv/32/41195_2.png) [@PedroBarbosapqv](https://forum.infinityfree.com/u/PedroBarbosapqv)\
**Post date:** [November 1, 2023, 1:03am UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/3 "2023-11-01T01:03:31Z")

</div>

Certo, tenho o domínio principal q possui a pastas htdocs, tenho a outra pasta do subdomínio que dentro tem a htdocs também e o código php, o código precisa enviar files para um diretório chamado diretorio na pasta htdocs do domínio principal, e o caminho que está dando erro. E na máquina local funciona.

---

<div class="post-metadata">

**Author:** ![ChrisPAR](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/chrispar/32/8743_2.png) [@ChrisPAR](https://forum.infinityfree.com/u/ChrisPAR)\
**Post date:** [November 1, 2023, 1:25am UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/4 "2023-11-01T01:25:13Z")

</div>

Can you share the code that is failing?

---

<div class="post-metadata">

**Author:** ![PedroBarbosapqv](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/pedrobarbosapqv/32/41195_2.png) [@PedroBarbosapqv](https://forum.infinityfree.com/u/PedroBarbosapqv)\
**Post date:** [November 1, 2023, 1:56am UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/5 "2023-11-01T01:56:08Z")

</div>

Eu posso lhe passar o acesso ftp para ter acesso ao diretório completo

---

<div class="post-metadata">

**Author:** ![PedroBarbosapqv](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/pedrobarbosapqv/32/41195_2.png) [@PedroBarbosapqv](https://forum.infinityfree.com/u/PedroBarbosapqv)\
**Post date:** [November 1, 2023, 1:56am UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/6 "2023-11-01T01:56:47Z")

</div>

Eu posso fornecer o acesso ftp para o diretório completo .

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 1, 2023, 12:33pm UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/7 "2023-11-01T12:33:39Z")

</div>

Again, this is an English language forum. Please write your posts in English.

Final warning: any Portuguese posts from now on will be flagged and deleted.

> [@PedroBarbosapqv](#):
>
> Right, I have the main domain that has the htdocs folders, I have another subdomain folder that also has the htdocs inside and the php code, the code needs to send files to a directory called directory in the htdocs folder of the main domain, and the path that it is showing an error. And on the local machine it works.

That’s not possible on our hosting I’m afraid. For security reasons, PHP code within any website directory can only access files within the htdocs directory of that site. PHP code of one site will not be able to read or write data to other sites.

As a workaround, you could try:

- Use a MySQL database instead. Databases of your account are not linked to a specific domain and can be accessed from all domains in your account.
- Use subdirectories instead of different domains. While you cannot write files between, say, [forum.example.com](http://forum.example.com) and [blog.example.com](http://blog.example.com), you can do so between [example.com/blog](http://example.com/blog) and [example.com/forum](http://example.com/forum), because they are all part of the same domain name.

> [@PedroBarbosapqv](#):
>
> I can give you ftp access to have access to the full directory

Please note this is a public forum. Please make sure to not publish any credentials here. Better yet: don’t share any credentials with anyone ever.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [November 8, 2023, 12:33pm UTC](https://forum.infinityfree.com/t/caminho-para-diretorio/85471/8 "2023-11-08T12:33:43Z")

</div>

Closed on November 8, 2023, 12:33pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
