<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: cURL file upload error with content-length mismatch in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127778#M56811</link>
    <description>Andreas,&lt;BR /&gt;&lt;BR /&gt;what is the format of your source file on the VMS system?&lt;BR /&gt;&lt;BR /&gt;Can you post a DIR/FULL for test.ras ?&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
    <pubDate>Wed, 03 Sep 2008 11:13:25 GMT</pubDate>
    <dc:creator>Duncan Morris</dc:creator>
    <dc:date>2008-09-03T11:13:25Z</dc:date>
    <item>
      <title>cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127777#M56810</link>
      <description>On VMS-Alpha:&lt;BR /&gt;When using an http-file-upload the file is not sent to the Server with the&lt;BR /&gt;correct content-length.&lt;BR /&gt;Sending a file with 511 or less bytes, content-length 512 is used.&lt;BR /&gt;Sending a file with 513 - 1023 bytes, content-length 1024 is used.&lt;BR /&gt;Files with a length of a multiple of 512 Bytes show the correct&lt;BR /&gt;content-length. Only these files work for upload.&lt;BR /&gt;&lt;BR /&gt;File test.doc has the size 21.504 (multiple of 512)&lt;BR /&gt;File test.ras has the size 5.686 (not a multiple of 512).&lt;BR /&gt;&lt;BR /&gt;Using test.doc everything works.&lt;BR /&gt;Using test.ras the Content-Length in the LOG-File differs from the content&lt;BR /&gt;length on Linux/Windows.&lt;BR /&gt;The receiving program (in my testcase "upload.pl") says that I have a&lt;BR /&gt;post-data mismatch.&lt;BR /&gt;&lt;BR /&gt;VMS shows:&lt;BR /&gt;002c: Content-Disposition: form-data; name="myfile"; filename="test.ra&lt;BR /&gt;006c: s"&lt;BR /&gt;0070: Content-Type: application/octet-stream&lt;BR /&gt;0098:&lt;BR /&gt;=&amp;gt; Send data, 6144 bytes (0x1800)&lt;BR /&gt;&lt;BR /&gt;Linux + Windows show:&lt;BR /&gt;002c: Content-Disposition: form-data; name="myfile"; filename="test.ra&lt;BR /&gt;006c: s"&lt;BR /&gt;0070: Content-Type: application/octet-stream&lt;BR /&gt;0098:&lt;BR /&gt;=&amp;gt; Send data, 5686 bytes (0x1636)&lt;BR /&gt;&lt;BR /&gt;My workaround: I wrote a perl-program to add some bytes to the file to have&lt;BR /&gt;a multiple of 512 Bytes. The CGI-Program (upload.pl) then reduces the&lt;BR /&gt;filesize back to the origin.&lt;BR /&gt;&lt;BR /&gt;This workaround works for all files with all sizes - but the error in curl&lt;BR /&gt;still remains.&lt;BR /&gt;&lt;BR /&gt;Now I have to say, that I'm not a C-Programmer, so I kindly ask for help.&lt;BR /&gt;&lt;BR /&gt;Used CURL-Version on all systems: 7.18.2.</description>
      <pubDate>Wed, 03 Sep 2008 10:21:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127777#M56810</guid>
      <dc:creator>Andreas Kaempfe</dc:creator>
      <dc:date>2008-09-03T10:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127778#M56811</link>
      <description>Andreas,&lt;BR /&gt;&lt;BR /&gt;what is the format of your source file on the VMS system?&lt;BR /&gt;&lt;BR /&gt;Can you post a DIR/FULL for test.ras ?&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Wed, 03 Sep 2008 11:13:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127778#M56811</guid>
      <dc:creator>Duncan Morris</dc:creator>
      <dc:date>2008-09-03T11:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127779#M56812</link>
      <description>Hello Duncan,&lt;BR /&gt;Andreas first opened this point for me - now I think it's better that I answer - because I have the problem.&lt;BR /&gt;&lt;BR /&gt;$ dir /full test.ras&lt;BR /&gt;&lt;BR /&gt;Directory DRA3:[USER]&lt;BR /&gt;&lt;BR /&gt;TEST.RAS;1                    File ID:  (168209,132,0)&lt;BR /&gt;Size:           12/118        Owner:    [USER]&lt;BR /&gt;Created:    18-AUG-2008 15:32:26.01&lt;BR /&gt;Revised:    18-AUG-2008 15:32:26.03 (1)&lt;BR /&gt;Expires:    &lt;NONE specified=""&gt;&lt;BR /&gt;Backup:     18-AUG-2008 21:37:59.55&lt;BR /&gt;Effective:  &lt;NONE specified=""&gt;&lt;BR /&gt;Recording:  &lt;NONE specified=""&gt;&lt;BR /&gt;Accessed:   &lt;NONE specified=""&gt;&lt;BR /&gt;Attributes: &lt;NONE specified=""&gt;&lt;BR /&gt;Modified:   &lt;NONE specified=""&gt;&lt;BR /&gt;Linkcount:  1&lt;BR /&gt;File organization:  Sequential&lt;BR /&gt;Shelved state:      Online&lt;BR /&gt;Caching attribute:  Writethrough&lt;BR /&gt;File attributes:    Allocation: 118, Extend: 0, Global buffer count: 0&lt;BR /&gt;                    No version limit&lt;BR /&gt;Record format:      Fixed length 512 byte records&lt;BR /&gt;Record attributes:  None&lt;BR /&gt;RMS attributes:     None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection:    System:RWED, Owner:RWED, Group:E, World:E&lt;BR /&gt;Access Cntrl List:  None&lt;BR /&gt;Client attributes:  None&lt;BR /&gt;&lt;BR /&gt;Due to your hint I tested following:&lt;BR /&gt;Use a file (test.ras) that is stored with&lt;BR /&gt;Record format:      Fixed length 512 byte records&lt;BR /&gt;and a file (trace.log) that is stored with&lt;BR /&gt;Record format:      Stream_LF, maximum 0 bytes, longest 32767 bytes&lt;BR /&gt;Uploading test.ras, curl uses the wrong file-size as described.&lt;BR /&gt;Uploading trace.log, curl uses the correct file-size.&lt;BR /&gt;&lt;BR /&gt;But: I need a solution to upload any file. I have binary files - max. size could be 20 MByte or more. And I do not have the chance to set the record format for every file during creation, because the files come from different systems (VMS-VAX, Unix, Windows, per ftp-client, ftp-server).&lt;BR /&gt;&lt;BR /&gt;What would you recomend?&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;</description>
      <pubDate>Wed, 03 Sep 2008 13:11:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127779#M56812</guid>
      <dc:creator>Harald Schwarz</dc:creator>
      <dc:date>2008-09-03T13:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127780#M56813</link>
      <description>Harald,&lt;BR /&gt;&lt;BR /&gt;I see that this has already been logged as a bug with cURL!&lt;BR /&gt;&lt;BR /&gt;This is fairly typical behaviour for software designed for *nix style filesystems.&lt;BR /&gt;&lt;BR /&gt;As you have already found, using STREAM_LF will produce the best results.&lt;BR /&gt;&lt;BR /&gt;Would it be possible for your upload script to use CONVERT/FDL to convert the source file to STREAM_LF format immediately prior to invoking cURL?&lt;BR /&gt;&lt;BR /&gt;PS: I see that cURL 7.19.0 is now available</description>
      <pubDate>Wed, 03 Sep 2008 13:40:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127780#M56813</guid>
      <dc:creator>Duncan Morris</dc:creator>
      <dc:date>2008-09-03T13:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127781#M56814</link>
      <description>Did you say the file has fixed length records of 512 bytes and the file size is not a multiple of 512?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Sep 2008 15:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127781#M56814</guid>
      <dc:creator>x2084</dc:creator>
      <dc:date>2008-09-03T15:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127782#M56815</link>
      <description>my last reply got chopped by the cursed itrc software!&lt;BR /&gt;&lt;BR /&gt;I should have also said to try&lt;BR /&gt;&lt;BR /&gt;SET FILE/ATTRIB=RFM=STMLF test.ras&lt;BR /&gt;&lt;BR /&gt;Depending upon the original source of the file, this may be all that is needed, rather than having to use CONVERT&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Wed, 03 Sep 2008 15:52:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127782#M56815</guid>
      <dc:creator>Duncan Morris</dc:creator>
      <dc:date>2008-09-03T15:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127783#M56816</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Did you say the file has fixed length&lt;BR /&gt;&amp;gt; records of 512 bytes and the file size is&lt;BR /&gt;&amp;gt; not a multiple of 512?&lt;BR /&gt;&lt;BR /&gt;It can happen.  Start with an odd-sized file&lt;BR /&gt;on a UNIX(-like) system, and use binary FTP&lt;BR /&gt;in a VMS FTP client program to transfer it to&lt;BR /&gt;a VMS system.  The VMS FTP client typically&lt;BR /&gt;creates a fixed-512 file.  The FFB should be&lt;BR /&gt;set, so that an application can still know&lt;BR /&gt;where the original end-of-file is, but the&lt;BR /&gt;"Record format: Fixed length 512 byte&lt;BR /&gt;records" stuff could fool someone.&lt;BR /&gt;&lt;BR /&gt;ra# uname -a&lt;BR /&gt;SunOS ra 5.10 Generic_127127-11 sun4u sparc SUNW,UltraSPARC-IIi-cEngine&lt;BR /&gt;&lt;BR /&gt;ra# ls -l fred.zip&lt;BR /&gt;-rw-r--r--   1 root     root        6995 Jul 31 09:40 fred.zip&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;alp $ tcpip show version&lt;BR /&gt;&lt;BR /&gt;  HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 7&lt;BR /&gt;  on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2  &lt;BR /&gt;&lt;BR /&gt;alp $ copy /ftp /binary ra"root passwd"::fred.zip []&lt;BR /&gt;alp $ dire /full fred.zip&lt;BR /&gt;&lt;BR /&gt;Directory ALP$DKA0:[SMS.FTPTEST]&lt;BR /&gt;&lt;BR /&gt;FRED.ZIP;1                    File ID:  (34824,11519,0)       &lt;BR /&gt;Size:           14/69         Owner:    [SMS]&lt;BR /&gt;[...]&lt;BR /&gt;Record format:      Fixed length 512 byte records&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;So you might think that its size is 14* 512&lt;BR /&gt;bytes = 7168 bytes, but it's not, really:&lt;BR /&gt;&lt;BR /&gt;alp $ write sys$output f$file_attributes( "fred.zip", "ffb")&lt;BR /&gt;339&lt;BR /&gt;&lt;BR /&gt;Or:&lt;BR /&gt;&lt;BR /&gt;alp $ bash&lt;BR /&gt;bash$ ls -l fred.zip&lt;BR /&gt;-rwxr-x---   1 SMS      40           6995 Sep  3 23:27 fred.zip&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Using my VMS adaptation of wget with its&lt;BR /&gt;--ftp-stmlf ("Use Stream_LF format for all&lt;BR /&gt;binary FTP files") option might help in some&lt;BR /&gt;cases, by avoiding the fixed-512 file format,&lt;BR /&gt;but that's a fetch-only program, not a&lt;BR /&gt;sender.&lt;BR /&gt;&lt;BR /&gt;If these files are being created on the VMS&lt;BR /&gt;system, then wget would seem not to help&lt;BR /&gt;here, but if the files are being fetched from &lt;BR /&gt;a UNIX system, then "wget --ftp-stmlf" might&lt;BR /&gt;be useful.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] rather than having to use CONVERT&lt;BR /&gt;&lt;BR /&gt;I'd expect CONVERT to mess with the data in&lt;BR /&gt;undesired ways.  "SET FILE/ATTRIB=RFM=STMLF"&lt;BR /&gt;sounds better to me.&lt;BR /&gt;&lt;BR /&gt;It might help to know how these files got to&lt;BR /&gt;be fixed-512 in the first place.&lt;BR /&gt;&lt;BR /&gt;Does sound like a cURL bug, though, if it's&lt;BR /&gt;ignoring the FFB (EOF marker) when it reads a&lt;BR /&gt;fixed-512 file.</description>
      <pubDate>Thu, 04 Sep 2008 03:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127783#M56816</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-09-04T03:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127784#M56817</link>
      <description>I know that it can happen, I just wanted to point out the "incompatibility".&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;Does sound like a cURL bug, though, if it's&lt;BR /&gt;ignoring the FFB (EOF marker) when it reads a&lt;BR /&gt;fixed-512 file.&lt;BR /&gt;&lt;BR /&gt;Yes, it looks like some software is reading record by record without checking if the last read record was complete.&lt;BR /&gt;&lt;BR /&gt;I would set the RFM to UDF rather than to STM_LF. Stream LF imposes a record structure based on the content. There was no record structure or there were fixed length records. The STM_LF doesn't match that  &lt;BR /&gt;&lt;BR /&gt;Whatever tool created the file (even if it is a copy/ftp/bin) the RFM looks wrong or at least confusing. If you do a binary ftp-get from a Unix system, why should the result have any VMS record format at all?&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Sep 2008 07:37:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127784#M56817</guid>
      <dc:creator>x2084</dc:creator>
      <dc:date>2008-09-04T07:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127785#M56818</link>
      <description>&amp;gt; [...] STM_LF doesn't match that&lt;BR /&gt;&lt;BR /&gt;True, but it works well with the C RTL.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] why should the result have any VMS&lt;BR /&gt;&amp;gt; record format at all?&lt;BR /&gt;&lt;BR /&gt;A fair question.  I assume that fixed-512 is&lt;BR /&gt;a very old convention which (almost) everyone&lt;BR /&gt;seems to follow.  Using anything else might&lt;BR /&gt;break a whole lot of existing software.</description>
      <pubDate>Thu, 04 Sep 2008 11:41:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127785#M56818</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-09-04T11:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127786#M56819</link>
      <description>I tested your suggestion:&lt;BR /&gt;SET FILE/ATTRIB=RFM=STMLF test.ras&lt;BR /&gt;and used curl for upload again - it worked.&lt;BR /&gt;Now I'm really happy :-))&lt;BR /&gt;&lt;BR /&gt;Thank you all for your support - it saved me a lot of time.&lt;BR /&gt;&lt;BR /&gt;To complete the information: &lt;BR /&gt;Some files come from a CAD-system on VMS-VAX. The system is quite old and stores the files always with 512 Bytes fixed record length. Due to the mass of interfaces and connected systems I cannot demand that I get no 512 Byte fixed record length.&lt;BR /&gt;&lt;BR /&gt;What next:&lt;BR /&gt;The whole thing seems to be a BUG of CURL - and I think that the tool ignores the FFB (EOF marker) - as some of you already mentioned. I will add a comment to the curl bug tracking list.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Sep 2008 06:18:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127786#M56819</guid>
      <dc:creator>Harald Schwarz</dc:creator>
      <dc:date>2008-09-05T06:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: cURL file upload error with content-length mismatch</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127787#M56820</link>
      <description>Thread closed because solution was found.</description>
      <pubDate>Fri, 05 Sep 2008 06:31:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/curl-file-upload-error-with-content-length-mismatch/m-p/5127787#M56820</guid>
      <dc:creator>Andreas Kaempfe</dc:creator>
      <dc:date>2008-09-05T06:31:27Z</dc:date>
    </item>
  </channel>
</rss>

