mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-09 20:01:08 +00:00
WebUI: Return error in case uploaded files are not torrents
This commit is contained in:
parent
8b8c9d3573
commit
ee3a736787
@ -260,7 +260,11 @@ void RequestHandler::action_command_upload()
|
||||
|
||||
if (!filePath.isEmpty())
|
||||
{
|
||||
QBtSession::instance()->addTorrent(filePath);
|
||||
QTorrentHandle h = QBtSession::instance()->addTorrent(filePath);
|
||||
if (!h.is_valid()) {
|
||||
status(415, "Internal Server Error");
|
||||
print(QObject::tr("Error: '%1' is not a valid torrent file.\n").arg(torrent.filename), CONTENT_TYPE_TXT);
|
||||
}
|
||||
// Clean up
|
||||
fsutils::forceRemove(filePath);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user