Archived Forum Post

Index of archived forum posts

Question:

Problem with CkUploadW class not uploading at all

Jan 22 '16 at 10:35

Hello,

I'm trying to perform the upload of a single file into the base directory of my web site; the code I'm using is very basic and looks like this:

CkUploadW upload;
upload.put_Hostname(L"www.myserver.com");
upload.put_Port(80);
upload.put_Path(L"/");
upload.put_Expect100Continue (false);
upload.put_Login (L"myLogin");
upload.put_Password (L"myPassword");

//  Add one or more files to be uploaded.
upload.AddFileReference(L"file1",L"c:\\test.mp3");

bool success;
success = upload.BlockingUpload();
if (success != true)
{
    CkString    strErr;
    upload.LastErrorText (strErr);
    strErr.saveToFileW (L"c:\\log.txt", L"utf-8");
}
else {

    printf("Files uploaded!\n");
}

When running this code it will reach the line which states "Files uploaded!" but, on the server, the file will not be available at all. Could someone be so kind to explain what I'm missing or where I should look to for understanding the issue?

Kind Regards

Severino


Accepted Answer

The Server Side/PHP script is outside of Chilkat's scope. There are lots of PHP upload script examples out there if you search. For example:

http://www.w3schools.com/php/php_file_upload.asp

In the above example, skip the Create the HTML form section - this is where the Chilkat example you originally posted does the work of the browser/HTML.


Answer

There has to be something on the server-side to receive the upload..

For example, see this: https://www.chilkatsoft.com/p/p_534.asp

The server-side code could be in any language -- C#, PHP, or whatever, but you must have some server-side code at the target URL to receive what is being sent and to decide what to do with it..


Answer

Thanks, now it's clearer. Any chance to have a PHP version of the server-side script?

Kind Regards

Severino Delaurenti