1

I am beginner in Operating Systems related stuff. I am working on a project. In this project, I want to know if user is uploading any confidential document on Internet via websites like Gmail ,etc. I don't want to use proxy or networking techniques for this.

If user uploads document to any website, the native FileChooser Dialog opens in any Operating System through which file to be uploaded is selected and opened. I want the path of the file chosen through this native FileChooser Dialog. Once I get the path, I can know through some logic (can't share it), if that file is confidential or not. File Chooser Dialog

So, I just want to know, how can I get the path of file that user has selected in FileChooser Dialog.

What I have done - Made Custom Dialog in Java but can't find a way to replace native OS dialog by this custom dialog. I also found the GNOME module for FileChooserDialog but I have no clue on how to proceed after it. I have visited all SO questions but they are not specific to my requirement.

I want a code (any language) or script based solution to this. Please help.

Operating System - Any GNOME based Linux Distribution (preferably Ubuntu)

Sachin Aggarwal
  • 1,095
  • 8
  • 17
  • browsers remove the path on purpose for privacy reasons. and how would the storage location have anything to say about whether a file's content was confidential or not? – Cee McSharpface Mar 23 '17 at 17:52
  • 1
    Ubuntu is not "GNOME based"... Unixoid systems, Linux especially, comes with a variety of graphical user interfaces, they all have there own, sometimes even multiple such dialogs. There is no way to handle them in a common way. – arkascha Mar 23 '17 at 17:56
  • Is there no way to intercept before the path reaches to browser from dialog. Since the dialog is from OS, can we get data from dialog. Or can we replace this native dialog by our custom dialog. Thanks :-) – Sachin Aggarwal Mar 23 '17 at 17:57
  • Also you have to consider the legal side of what you attempt. In most countries around the world such spying activity is considered illegal, even inside company networks or similar. – arkascha Mar 23 '17 at 17:58
  • 1
    and we have drag-and-drop-based uploads in html5 and flash, which won't ever display a file open dialog – Cee McSharpface Mar 23 '17 at 17:58
  • And finally you could simply copy&paste the file path from a file manager or even type it manually... – arkascha Mar 23 '17 at 17:59
  • @arkascha Sorry about that. I am a beginner. But is it possible for any individual distribution. Not maybe a common way to handle all. – Sachin Aggarwal Mar 23 '17 at 18:00
  • 1
    First as said before: this depends on the graphical user interface, not on the distribution. Most distribution offer different ones for the user to chose from. And second, I do not see an immediate way to somehow "intercept" the chosen path in the situation sketched. You might be able to do that by replacing the system library implementing that dialog by a wrapper - but hey... what an effort. – arkascha Mar 23 '17 at 18:02
  • @arkascha Thanks for telling the other sides to this. But still out of curiosity (have spent a lot of time on this), can we get the path. – Sachin Aggarwal Mar 23 '17 at 18:04
  • @arkascha Thanks :-) – Sachin Aggarwal Mar 23 '17 at 18:05
  • Possible duplicate of [How to resolve the C:\fakepath?](http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath) – Cee McSharpface Mar 23 '17 at 18:06

0 Answers0