login about faq

For some reason i am not able to upload a file from my c: drive to the ftp-server (my NAS).

    //  Change to the remote directory where the file will be uploaded.
$success = $ftp->ChangeRemoteDir('/Web/ftpdata/');
if ($success != true) {
    print $ftp->lastErrorText() . "\n";
    exit;
}

//  Upload a file.
$localFilename = 'c:/test.ico';
$remoteFilename = 'test.ico';

$success = $ftp->PutFile($localFilename,$remoteFilename);
if ($success != true) {
    print $ftp->lastErrorText() . "\n";
    exit;
}

See attached message:

Blockquote ChilkatLog: PutFile: DllDate: Aug 9 2012 UnlockPrefix: Anything for 30-day trial Username: MY-NAS: Architecture: Little Endian; 32-bit Language: Linux PHP VerboseLogging: 0 LocalFilename: c:/test.ico RemoteFilename: test.ico hcCurDate: Wed, 26 Sep 2012 12:15:43 +0200 hcExpire: 11/2012 IdleTimeoutMs: 60000 ReceiveTimeoutMs: 60000 ConnectTimeoutSeconds: 60 Failed to get local file size. localFilePath: c:/test.ico --PutFile TotalTime: Elapsed time: 0 millisec Failed. --ChilkatLog

asked Sep 26 '12 at 06:22

RootTag's gravatar image

RootTag
35121623

edited Sep 26 '12 at 06:45


The LastErrorText indicates you're running on Linux, but you're passing a local file path starting with "C:/" ?

link

answered Sep 26 '12 at 08:00

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

So i have got it the wrong way i guess...wanted the user to visit our website and use a php-script to let him upload a file (from his hdd) to our ftp-server.

Looks like i have to write an application in e.g. c++ and give it to the customers. Webbased would be so much smarter ;)

link

answered Sep 26 '12 at 08:05

RootTag's gravatar image

RootTag
35121623

Your PHP script runs on the server, not on the client where the web browser is running.

link

answered Sep 26 '12 at 08:16

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Thank you for clarification.

Do you provide any example on how to upload files to a webserver which does not support ASP.NET but PHP with Chilkatlib?

link

answered Sep 26 '12 at 08:25

RootTag's gravatar image

RootTag
35121623

You cannot use Chilkat from within a browser. You would never want to try using the FTP protocol from the client-side -- it would be fraught with problems -- namely firewalls, anti-virus, client-side software firewalls, etc.

HTTP uploads are accomplished via HTML or Javascript. I cannot help more with this because the Internet is abundant with resources, examples, and information regarding the topic..

link

answered Sep 26 '12 at 11:59

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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:

×50
×35

Asked: Sep 26 '12 at 06:22

Seen: 2,437 times

Last updated: Sep 26 '12 at 11:59

powered by OSQA