login about faq

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

asked Jan 21 at 09:57

Seve65's gravatar image

Seve65
3


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.

link

answered Jan 22 at 10:35

jpbro's gravatar image

jpbro ♦
1.1k2618

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..

link

answered Jan 21 at 13:58

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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

Kind Regards

Severino Delaurenti

link

answered Jan 22 at 05:02

Seve65's gravatar image

Seve65
3

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×9

Asked: Jan 21 at 09:57

Seen: 344 times

Last updated: Jan 22 at 10:35

powered by OSQA