27
Views
1
Comments
[File Upload] File path is disclosing in browser network tab after file uploading
file-upload
Web icon
Forge asset by Alfaro
Application Type
Traditional Web

Hi Team,

We are using the File Upload component from the forge in one of the applications. The Security team reported an issue that the file path is getting exposed in the browser network tab after file uploading. So please help me with this and suggest how we can hide the path. 

File Upload Component Url:

https://www.outsystems.com/forge/component-overview/352/file-upload

2022-12-09 09-54-41
Gaurav Rawat

Hi @Shailendra Shrivastava,

You can achieve it by making change in component 

Go to fileuploadHandler screen-->Prepartion -->JsonResponse

change it from 

JsonResponse + 

"{

    ""name"":""" + Replace(EscapeDataString(GetRequestFiles.RequestFiles.Current.RequestFile.FileName),"\","\\") + """,

    ""size"":" + GetRequestFiles.RequestFiles.Current.RequestFile.FileSize + ",

    ""url"":""" + Replace(Path_GetTemporaryFileName.FileName,"\","\\") + """,

    ""thumbnail_url"":"""",

    ""delete_url"":"""",

    ""delete_type"":"""",

    ""type"":""" +  Replace(GetRequestFiles.RequestFiles.Current.RequestFile.FileType,"/","//") + """

},"

TO


JsonResponse + "{    ""name"":""" + Replace(EscapeDataString(GetRequestFiles.RequestFiles.Current.RequestFile.FileName),"\","\\") + """,    ""size"":" + GetRequestFiles.RequestFiles.Current.RequestFile.FileSize + ",    ""thumbnail_url"":"""",    ""delete_url"":"""",    ""delete_type"":"""",    ""type"":""" +  Replace(GetRequestFiles.RequestFiles.Current.RequestFile.FileType,"/","//") + """},"



Now in network tab there is no information about the url like this.


Thanks,

Gaurav Rawat

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.