Getting complete PATH of uploaded file - PHP -
I have a form (HTML, PHP) that uploads the file to update the end user database (MySQL) The record in the uploaded file (especially .csv) However, in phpscript, I can only get the file name and not the full path of the specific file. For this reason, FOPN () fails. Can anyone please tell me how can I find the complete path?
HTML code:
& lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form method = "POST" action = "upload.php" enactepe = "multipart / form-data" & gt; & Lt; P & gt; File to upload: & lt; Input type = "file" name = "UploadFileName" & gt; & Lt; / P & gt; & Lt; Br / & gt; & Lt; Input type = "submit" name = "submit" value = "press it to upload" & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt; PHP Script:
name file name to client-side . To get a file name (including full path) on server-side , you must use tmp_name : $ handle = fopen ($ _FILES ["UploadFileName"] ["tmp_name"], 'R');
Comments
Post a Comment