help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

content-type problem writing uint8 to file/database using curl


From: dbjrmn
Subject: content-type problem writing uint8 to file/database using curl
Date: Tue, 7 Dec 2010 22:19:59 -0800 (PST)

I have values in a  vector of type double that go from 0 to 255. I can print
those values just fine using fprintf and num2str. I cast the values from
double to uint8 and try to save them to Couchdb using the curl command. In
doing so, all values above 127 become 0. If I just write them as double, in
addition to wasting space the values are wrong with zeros interspersed. What
I have done (that works) is convert to png, use the binary encoding, and I
was able to recover the persisted data. The problem is I want to defer the
png conversion until after the files are retrieved from the database. Any
guidance will be greatly appreciated. 

Here are a few of the many curl dat/content-type options I have tried (I
know they probably should match): 

cstrcat("curl -X PUT ", fileUrl, "?rev=", rev,  " --data-binary @",
filenameAndPath, " -H \"Content-Type: text/html\"");


cstrcat("curl -X PUT ", fileUrl, "?rev=", rev, " --data-binary @",
filenameAndPath, " -H \"Content-Type: application/octet-stream\"");

cstrcat("curl -X PUT ", fileUrl, "?rev=", rev, " --data-ascii @",
filenameAndPath, " -H \"Content-Type: text/plain\"");

Thanks

David

-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/content-type-problem-writing-uint8-to-file-database-using-curl-tp3077758p3077758.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]