Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<input type=‘file’> for IE gives full path, need file name only

When perform uploading from IE browser, that my backend(org.apache.commons.fileupload) gets full file path.

For other non-IE browsers it gets filename and it's OK because of security.

How to get filename only from input for IE?

Is it possible to do on UI, because I think it's not very graceful to edit apache lib.

Maybe , some parameter exists for input field?

I can do it on server, but interested in UI approach.

like image 227
sergionni Avatar asked Feb 04 '10 13:02

sergionni


People also ask

Does full path include filename?

Paths include the root, the filename, or both. That is, paths can be formed by adding either the root, filename, or both, to a directory.

How do I get the full path of a filename?

Click the Start button and then click Computer, click to open the location of the desired file, hold down the Shift key and right-click the file. Copy As Path: Click this option to paste the full file path into a document. Properties: Click this option to immediately view the full file path (location).

How it is possible to get path and filename of the given file?

A path may contain the drive name, directory name(s) and the filename. To extract filename from the file, we use “GetFileName()” method of “Path” class. This method is used to get the file name and extension of the specified path string. The returned value is null if the file path is null.

How can I get full path of uploaded file in HTML using jquery?

var fullPath = $('#fileUpload1'). val();


1 Answers

There is also an IE option under:

  • Internet Options
  • Security tab
  • In "Internet" or "Intranet" click on Custom Level
  • In the Security Settings scroll down until you see “Include local directory path when uploading files to a server” and disable it.
  • Click OK on Internet Options window and refresh.
like image 192
Almalerik Avatar answered Sep 22 '22 08:09

Almalerik