1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

Cancel upload when trying to upload non-readable files.

This commit is contained in:
nowrep 2013-04-04 20:32:34 +02:00
parent faeba013bc
commit 7c57588738
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@ Version 1.5.0
* added support for Proxy Auto-Config (PAC)
* added option to open another private window from private window
* added delete action in edit context menu on page
* cancel upload when trying to upload non-readable files
* GreaseMonkey: added support for GM_Settings
* fixed: size of preferences dialog on low-res screens

View File

@ -990,6 +990,14 @@ QString WebPage::chooseFile(QWebFrame* originatingFrame, const QString &oldFile)
if (!fileName.isEmpty()) {
s_lastUploadLocation = fileName;
// Check if we can read from file
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
const QString &msg = tr("Cannot read data from <b>%1</b>. Upload was cancelled!").arg(fileName);
QMessageBox::critical(view(), tr("Cannot read file!"), msg);
return QString();
}
}
return fileName;