Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

inputfile into html inside webengine not upload



  • Hello,
    Why not upload file from inputfile element html ??
    I have see this QT message in debug.
    1f171588-c766-4cc6-a506-f3a29c16f6ee-image.png
    All control for upload file is into javascript code.
    What did I forget?
    Thanks for your help.



  • I have same problem ;

    in Qt5.14.2/5.14.2/Src/qtwebengine/src/core/file_picker_controller.cpp file in qt sources there is an accept function with qlist input arg

    void FilePickerController::accepted(const QVariant &files)
    {
        if (!files.canConvert(QVariant::StringList))
            qWarning("An unhandled type '%s' was provided in FilePickerController::accepted(QVariant)", files.typeName());
    
        accepted(files.toStringList());
    }
    

    and an other accept function with qstringlist input arg

    void FilePickerController::accepted(const QStringList &files)
    {
        QStringList stringList;
        stringList.reserve(files.count());
    
        for (const QString &urlString : files) {
            // We accept strings on both absolute-path and file-URL form:
            if (QDir::isAbsolutePath(urlString)) {
                QString absolutePath = QDir::fromNativeSeparators(urlString);
    #if defined(OS_WIN)
                if (absolutePath.at(0).isLetter() && absolutePath.at(1) == QLatin1Char(':') && !base::FilePath::IsSeparator(absolutePath.at(2).toLatin1()))
                    qWarning("Ignoring invalid item in FilePickerController::accepted(QStringList): %s", qPrintable(urlString));
                else
    #endif
                    stringList.append(absolutePath);
            } else {
                QUrl url(urlString, QUrl::StrictMode);
                if (url.isLocalFile() && QDir::isAbsolutePath(url.toLocalFile())) {
                    QString absolutePath = url.toLocalFile();
    #if defined(OS_WIN)
                    if (absolutePath.at(0).isLetter() && absolutePath.at(1) == QLatin1Char(':') && !base::FilePath::IsSeparator(absolutePath.at(2).toLatin1()))
                        qWarning("Ignoring invalid item in FilePickerController::accepted(QStringList): %s", qPrintable(urlString));
                    else
    #endif
                        stringList.append(absolutePath);
                } else
                    qWarning("Ignoring invalid item in FilePickerController::accepted(QStringList): %s", qPrintable(urlString));
            }
        }
    
        FilePickerController::filesSelectedInChooser(stringList);
    }
    

    I guess it won't change to qstringlist in first function
    I don't know what to do to solve this problem



  • @mmjvox 24/5000
    I still haven't solved it



  • I am running into the same issue. Any clues ?

    Julien.



  • please provide a minimum and reproducible example


Log in to reply