Page 1 of 1
how can i get full local file path ?
Posted: Tue Sep 28, 2010 6:12 am
by ScOrPi
Hi all
how can i get full file url from file input form ?
i mean now if i use this code
var a = document.getElementById("ali").files.item(0).fileName();
it'll give me the name only i need the full path like " C:\new\ ... ect "
how can i get that ?
is the .filePath(); ? or something like it ?
cuz i need it to upload file from php script ..
thanks,
Re: how can i get full local file path ?
Posted: Tue Sep 28, 2010 3:04 pm
by John Cartwright
As far as I know, atleast with the newest browsers, they will not give you this information in the scope of javascript.
Re: how can i get full local file path ?
Posted: Tue Sep 28, 2010 3:51 pm
by AbraCadaver
And I don't see why you need this to upload a file using PHP.
Re: how can i get full local file path ?
Posted: Tue Sep 28, 2010 4:17 pm
by ScOrPi
John Cartwright wrote:As far as I know, atleast with the newest browsers, they will not give you this information in the scope of javascript.

is that mean it's impossible to get the full file path ?
i need it cuz when i set the request header to multipart/form-data using post method $_FILES would give me error 3 (partial upload)
tmp_name = empty
type = empty ..
name = only filename without path

Re: how can i get full local file path ?
Posted: Tue Sep 28, 2010 4:19 pm
by ScOrPi
AbraCadaver wrote:And I don't see why you need this to upload a file using PHP.
it's bucause i need to upload file without refresh my page and the link appear without redirect ..
i need it to be AJAX 100%
Re: how can i get full local file path ?
Posted: Tue Sep 28, 2010 4:22 pm
by John Cartwright
Posting an upload form through ajax and posting the form through conventional means are nearly identical.
It would be helpful to post your existing code to determine where you wen't wrong with that.
Re: how can i get full local file path ?
Posted: Tue Sep 28, 2010 4:28 pm
by ScOrPi
John Cartwright wrote:Posting an upload form through ajax and posting the form through conventional means are nearly identical.
It would be helpful to post your existing code to determine where you wen't wrong with that.
i'll try what u'd said ..
thank you for ur help
