cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: File upload in Windows

From: Guenter Knauf <eflash_at_gmx.net>
Date: Wed, 7 Jul 2004 12:41:22 +0200

Hi,
> On Tue, 6 Jul 2004, Andres Garcia wrote:

>> As you can see in the autobuild page, the file upload tests in Windows
>> fail,

> Nice catch! Fixed and committed now.

nice catch for me either since I found some other things which do not always work on NetWare...

on NetWare we have volumes which are silmiar to drives on Win32, OS/2; but:
the volume name can be up to 16 chars, so I will need to introduce a similar part for NetWare as is already in for Win32 (lines 122-153); and in addition NetWare can use both / and \ as separator:

/tmp/test.nlm
\tmp\test.nlm
my_special-volume:/tmp/test.nlm
vol1:/test.nlm
vol1:\test.nlm
vol1:/test.nlm
vol1:/tmp\etc/test.nlm

all these are valid paths on NetWare, and the real special thing is the following where a servername appears in front of the volume name:

servername[48]/volume[16]:path

that means that we can have a slash even before the path has started....

so seems I have to hack a bit in files.c to enable this all....

now to the recent patch: can we perhaps use something like that to allow both / and \ ??

--- file.c.orig Wed Jul 07 11:00:44 2004
+++ file.c Wed Jul 07 11:37:32 2004
@@ -180,16 +180,10 @@
   return CURLE_OK;
 }
 
-#if defined(WIN32) || defined(__EMX__)
-#define DIRSEP '\\'
-#else
-#define DIRSEP '/'
-#endif
-
 static CURLcode file_upload(struct connectdata *conn)
 {
   struct FILEPROTO *file = conn->proto.file;
- char *dir = strchr(file->path, DIRSEP);
+ char *dir;
   FILE *fp;
   CURLcode res=CURLE_OK;
   struct SessionHandle *data = conn->data;
@@ -198,6 +192,9 @@
   size_t nwrite;
   curl_off_t bytecount = 0;
   struct timeval now = Curl_tvnow();
+
+ if (!(dir = strchr(file->path, '/')))
+ dir = strchr(file->path, '\\');
 
   /*
    * Since FILE: doesn't do the full init, we need to provide some extra

Guenter.
Received on 2004-07-07

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET