Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i`m making program taking my picture and uploading at http SERVER.
now i already successed to make uploading picture by using Networkmanager.post function.
but i have some problem.

post function is needed request and QDeviceIO type object.
so if i upload image, i have to upload by QFile or QBuffer.

if i read QFile from local directory, i could upload file to HTTP SERVER.
but, i don`t want make Image file on local directory.

i need to send Image from QImage ( not from File on local Directory )

anyone know how can i upload QImage to HTTP SERVER without making ImageFile ?

What I have tried:

QByteArray bytes;
QBuffer* buffer = new QBuffer(&bytes);
buffer->open(QIODevice::ReadWrite);
(QImage)file->save(buffer,"PNG");

but when i tried upload, it coudln`t be uploaded.

if i upload by using this code ( from local Directory )

QFile* buffer = new QFile("test.png");
uploading was successed.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900