Solved

Make directory with copy

Posted on 2009-05-14
2
203 Views
Last Modified: 2012-05-07
How can I create a directory if it does not already exsist when using copy() ?
copy($filename,'my/directory/that/needs/to/be/created/'.$filename);

Open in new window

0
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 24388018
Look at mkdir()
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 24388044
But after reading the fine man page, it looks like the second parameter is a path, and will be created for you.  PHP 4 or PHP 5?

http://us.php.net/manual/en/function.mkdir.php
http://us.php.net/manual/en/function.copy.php
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question