Thursday, January 23, 2014

Resolve C:\fackpath in upload field instead o the full path

For the security reason this fackpath introduced and there is no way to show the actual path instead of the fackpath.

Just one way to replace the fackpath and show only the uploaded file name.

// check for IE's lovely security speil
if(filePath.match(/fakepath/)) {
  // update the file-path text using case-insensitive regex
  filePath = filePath.replace(/C:\\fakepath\\/i, '');
}

To replace the "\" in the URL use the below line of code.


this.value.replace(/\\\\/g, '');


No comments:

Split the String values with a special character in MS Flow to convert this into Array

 Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...