Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    lilshootr07
    lilshootr07's Avatar
    Guest

    How do i add an create a directory and add a file to it using PHP?

    Some sample code i used was..
    mkdir("/root/path/folder/subfolder");
    $root = '/root/path/folder/subfolder/';
    $file_name = $root.basename($_FILES['uploadFile'. $x]['name']);
    $copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$file_name);

    This adds the file to the folder and not the subfolder...
    Please help me, im new to PHP

  2. #2
    just "JR"
    just "JR"'s Avatar
    Guest
    Review the "basename" function in Php (www.php.net): you got it wrong!
    Also check "is_uploaded_file" and "move_uploaded_file" functions.

 

 

Quick Reply Quick Reply

Click here to log in


What comes after M0nday

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 12-12-2009, 03:51 AM
  2. Replies: 0
    Last Post: 12-09-2009, 12:13 AM
  3. Replies: 0
    Last Post: 09-20-2009, 01:35 PM
  4. Replies: 1
    Last Post: 05-21-2009, 01:19 AM
  5. Replies: 0
    Last Post: 05-14-2009, 02:02 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •