Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Rename folder question

New Here ,
Jun 06, 2009 Jun 06, 2009

I create and upload files to a folder named "files". How would I create a form that let's me input a new folder name, and when I hit a Submit Button, the folder "files" is renamed to the new name I input into form? I am using PHP.

TOPICS
Server side applications
981
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 06, 2009 Jun 06, 2009

You would need to incorporate some of php's file system functions into your script:

http://www.php.net/manual/en/ref.filesystem.php

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 06, 2009 Jun 06, 2009

I looked there before I asked the question here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 07, 2009 Jun 07, 2009
LATEST

Volsupporter wrote:

I looked there before I asked the question here.

Then what specifically is your question? What do you not understand about the file system functions?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 07, 2009 Jun 07, 2009

I think that the rename php function would do the job. Let's say you have the post of the folder name comes from the form as the value of $_POST['folder'] .

With the mentioned function you can create folder easy

rename ('files',''.$_POST['folder'].'' );

Regards

Zoli

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines