Jump to content
UBot Underground

How To Select A Local File Full Path From Html


Recommended Posts

I'm doing a bot where based on interfaces created with "load HTML" , now I need to select one local file to be uploaded, the problem is that the HTML doesn't allow to get the full path of the file so I'm looking for a workaround without to use "ui html" but the simple "load html", I like to use a single tab and change the interfaces on the fly...

 

Someone know how this could be done?

 

I tried to use "ui open file" in "ui html" it works giving the full path but... I cannot find the way to show again the selected file when I come back in the same tab, is there a way to have the "ui open file" showing the file on the var? I tried with fillwith="value" but it's not working... any suggestion?

Link to post
Share on other sites

this is from stackoverflow maybe not true but I trust their word

 

For security reasons browsers do not allow this, i.e. JavaScript in browser has no access to the File System, however using HTML5 File API, only Firefox provides a mozFullPath property, but if you try to get the value it returns an empty string:

$('input[type=file]').change(function () {
console.log(this.files[0].mozFullPath);
});

http://jsfiddle.net/SCK5A/

So don't waste your time.

edit: If you need the file's path for reading a file you can use the FileReader API instead. Here is a related question on SO: Preview an image before it is uploaded.

Link to post
Share on other sites

ayman has a file dialog picker plugin,I dont have it but with this you could certainly do it

 

<button onClick='ubot.runScript("filePickerFunction()")'>pick file</button>

 

and make a function that picks the file

Link to post
Share on other sites

Hi deliter thank you again!!

 

I tried to use the FileReader API , it does work on an html ( http://jsfiddle.net/LvsYc/ ) file but it doesn't work on ubot, I tried with "load html" and with "UI html panel" but nothing to do...

 

I saw the plugin, it does many things and it is a good plugin for sure but quite expensive just to pic a file :)

 

I think I should move everything on UI HTML PANEL and use UI OPEN FILE...

 

Thank you anyway!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...