cURL / Mailing Lists / curl-library / Single Mail


File upload in Windows

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


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
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, '\\');
  char *dir = strchr(file->path, '/');

A kludge, but then again, this is Windows.

Received on 2004-07-06