Does anyone know how I would get the local path to a file a user has specified with a file input form element?
I am trying to read the contents of this file and then send it via email without having to upload the file. Here is what I have so far for the file read:
#set up varaibles for easy reference
$file_name = $HTTP_POST_FILES["newsletter"]["name"]; #the file name
$file_temp = $HTTP_POST_FILES["newsletter"]["temp"]; #temporary location of file storage
$file = $file_temp.$file_name; #file reference
#open file and insert content
$fo = fopen($file,"r");
$letter = fread ($fo, filesize ($file));
fclose($fo);
I keep getting an error telling me that the re is no such file. It is trying to read off of the server and not from teh local file.
Seems like a pretty simple fix?!