cURL / Mailing Lists / curl-library / Single Mail

curl-library

File upload in Windows

From: Andres Garcia <andres_at_verot.com>
Date: Tue, 06 Jul 2004 13:36:58 +0200

Hi,

As you can see in the autobuild page, the file upload tests in Windows fail,
the reason is that the '/' get changed to '\' internally, so when the
'file_upload'
function does

char *dir = strchr(file->path, '/');

a NULL is returned and the transfer fails.

Doing this works:

#if defined(WIN32) || defined(__EMX__)
  char *dir = strchr(file->path, '\\');
#else
  char *dir = strchr(file->path, '/');
#endif

A kludge, but then again, this is Windows.

Andres
Received on 2004-07-06