How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?

后端 未结 11 2571
谎友^
谎友^ 2020-11-21 04:36

How to get full path of file while selecting file using




        
11条回答
  •  迷失自我
    2020-11-21 05:30

    You can't. Security stops you for knowing anything about the filing system of the client computer - it may not even have one! It could be a MAC, a PC, a Tablet or an internet enabled fridge - you don't know, can't know and won't know. And letting you have the full path could give you some information about the client - particularly if it is a network drive for example.

    In fact you can get it under particular conditions, but it requires an ActiveX control, and will not work in 99.99% of circumstances.

    You can't use it to restore the file to the original location anyway (as you have absolutely no control over where downloads are stored, or even if they are stored) so in practice it is not a lot of use to you anyway.

提交回复
热议问题