cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1156287 ] Can not upload a zip file in OpenVMS

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 17 Mar 2005 16:09:14 -0800

Bugs item #1156287, was opened at 2005-03-03 15:17
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1156287&group_id=976

Category: ftp
Group: bad behaviour
Status: Open
Resolution: Works For Me
Priority: 6
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Can not upload a zip file in OpenVMS

Initial Comment:
Hi there,

I have tried to upload a zip file with the following
command and always received a 'Uploaded unaligned
file size' error and the zip file is just partially uploaded to
ther server

curl -v -u user:password --upload-file myfile.zip
ftp://myftpserver

I tried to use the same option to upload a binary file
(e.g. wordpad.exe) or a text file, it all worked fine.

The Curl I am using was download from the link "VMS
Alpha 7.13.0 binary Marty Kuhrt 1777 KB " and I am
using OpenVMS here.

I also tested the windows version of Curl and the zip file
can be uploaded without any problems.

By the way, if I add the -crlf option, the zip file then can
be uploaded without the error, but the file size is
increased by a coulpe of bytes and I can't use winzip to
open it as it said the file is not in the right format.

Any ideas why this would happen?

Thanks

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-03-17 16:09

Message:
Logged In: NO

Well, the problem is that Curl for VMS version does not have
a same behavior as Curl for windows or any other ftp client
software in terms of uploading the files, which has LF
character insides (not necessary a binary file or ascii file).
You can easily repeat this issue if you try it on a VMS
machine.

Also I am not complaining the --crtl option, on the contrary, I
am saying this is the only way that we can play around with
the problem.

If you read the source code, you can see that with the --crtl
option, curl explicitly read the file byte by byte to do the
translation if needed, and then put them into a new buffer to
send. While, without --crtl option, it just reads the file block
by block to the buffer and somehow it can be partialy sent if
there is a LF.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-03-14 05:14

Message:
Logged In: YES
user_id=1110

If you use --crlf it will modify the contents, yes. But then
you asked for it and curl can't be blamed.

You said you are doing a binary transfer and then you should
NOT need any translations and thus --crlf is plain wrong to
use. Why do you need to translate a binary file?

What "file size calculation bug" are you referring to?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-03-14 03:44

Message:
Logged In: NO

libcurl may no do the translation, but it may chop the content
after the last 'lf' because of the file size calculation bug - this
is just my guess.

Ching

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-03-14 03:41

Message:
Logged In: NO

well, I don't think so. Because, if you add the --crlf option,
curl will actually replace each 'lf' to 'crlf' before sending them -
you can see this from the source code. Also, I can upload
the file to my ftp server with ftp client built in VMS without
any problem. So it means the problem is in curl, not the ftp
server.
BTW, I found this problem is not only to do with the zip file, it
is actually to with any file that has 'lf' character in it.

Ching

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-03-11 04:51

Message:
Logged In: YES
user_id=1110

Still, if a binary transfer doesn't send the file binary
without any kind of translation, the bug is in your ftp
server. libcurl does no translation at all.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-03-09 03:32

Message:
Logged In: NO

My soluction for this is:

1) Add --crlf option before sending the zip file
2) Build a program to read through the received file and
convert each CRLF back to LF and save it as a new file
3) Use winzip to open this new file.

It seems to be working in this way.

Ching

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-03-04 00:56

Message:
Logged In: YES
user_id=1110

I don't know much about VMS and file modes/types, but I
don't see how a zip file differs from an exe or a text file,
since curl sends the data using binary mode and uses simple
file operations to read (binary) data from the file and
sends it.

curl doesn't even support ftp ascii transfers properly (and
you're not using that).

I don't know what to do here.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-03-03 21:05

Message:
Logged In: NO

I can tell It was using Binary transfer mode during the
transmission as I can see the 'Type Set to I ' command on
the screen.

It seens to me that this issue is to do with the LF character.
If I force to use -crlf option, the file can be transferred but with
the size being increased. But if you don't specify this option,
curl seems to drop the LF character or do some funny thing
to it.

 

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-03-03 16:48

Message:
Logged In: YES
user_id=1110

Uh, in what way is a zip file _not_ a binary file?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1156287&group_id=976
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-tracker
Received on 2005-03-18

These mail archives are generated by hypermail.

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

File upload with ASP.NET