how can i get full local file path ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ScOrPi
Forum Commoner
Posts: 44
Joined: Fri Jul 09, 2010 8:01 am
Location: BAGHDAD - IRAQ

how can i get full local file path ?

Post 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,
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: how can i get full local file path ?

Post 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.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: how can i get full local file path ?

Post by AbraCadaver »

And I don't see why you need this to upload a file using PHP.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
ScOrPi
Forum Commoner
Posts: 44
Joined: Fri Jul 09, 2010 8:01 am
Location: BAGHDAD - IRAQ

Re: how can i get full local file path ?

Post 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.
:banghead: 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 :banghead:
ScOrPi
Forum Commoner
Posts: 44
Joined: Fri Jul 09, 2010 8:01 am
Location: BAGHDAD - IRAQ

Re: how can i get full local file path ?

Post 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%
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: how can i get full local file path ?

Post 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.
ScOrPi
Forum Commoner
Posts: 44
Joined: Fri Jul 09, 2010 8:01 am
Location: BAGHDAD - IRAQ

Re: how can i get full local file path ?

Post 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 :)
Post Reply