From 4282b07d77372c549efd6ec8209d7a6be2aaacdb Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 26 Mar 2009 03:11:17 +0000 Subject: [PATCH] Fix uploading of files by relative path name. Use io.getFile(path).path instead of just path in order to create an absolute path. --- common/content/buffer.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 4cd9fdeb..a9cb4831 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1021,7 +1021,16 @@ function Buffer() //{{{ } else if (elemTagName == "input" && elem.getAttribute('type').toLowerCase() == "file") { - commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value}); + commandline.input("Upload file: ", function (path) + { + let file = io.getFile(path); + + if (!file.exists()) + return liberator.beep(); + + elem.value = file.path; + } + , {completer: completion.file, default: elem.value}); return; } @@ -1131,7 +1140,16 @@ function Buffer() //{{{ } else if (localName == "input" && elem.getAttribute('type').toLowerCase() == "file") { - commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value}); + commandline.input("Upload file: ", function (path) + { + let file = io.getFile(path); + + if (!file.exists()) + return liberator.beep(); + + elem.value = file.path; + } + , {completer: completion.file, default: elem.value}); return; }