Jump to content

file upload trouble


jpratt

Recommended Posts

I am using $_FILES['userfile']['name'] to get a name of a file to copy from a users machine to place on a thumb drive. The user is basically copying the file from a local path to a local path using a portable version of php on their own comp. How do i get the path for copying the file? I have a form with enctype="multipart/form-data". How can i get the source path?

Link to comment
Share on other sites

Just an example...

<?php
// your upload directory
$uploadDir = 'path_to_your_directory/';  
// your file which is uploaded
$frfilename=$_FILES['userfile']['name'];  
// your path..... is this 
$filePathgif = $uploadDir.$frfilenamegif; 
// echo and confirm...
echo "$filePath";
?>

Link to comment
Share on other sites

Thanks for the help but that gives me the desination wich is not the problem, I am trying to get the entire source path to copy from. When I do $_FILES['userfile']['name'] it gives me the source filename but nothing before it? is there a way to get the entire source destination?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.