﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
3818	Writing at offset=0 using REST API fails for empty files	derkades		"Trying to write a single byte at offset 0 to an empty SDMF file:
{{{
FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=sdmf')
curl -X PUT --data a ""http://10.0.1.1:26551/uri/$FILE_CAP?offset=0"" > error1.html
}}}
or MDMF:
{{{
FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=mdmf')
curl -X PUT --data a ""http://10.0.1.1:26551/uri/$FILE_CAP?offset=0"" > error2.html
}}}
Please find error files attached.

No offset works:
{{{
curl -X PUT --data a ""http://10.0.1.1:26551/uri/$FILE_CAP""
}}}
Now that the file contains 1 byte ('a'), we can write at offset=1 to make it 2 bytes long ('aa'):
{{{
curl -X PUT --data a ""http://10.0.1.1:26551/uri/$FILE_CAP?offset=1""
}}}
Also overwriting the first byte seems to work, but actually overwrites the entire file (unrelated issue?):
{{{
curl -X PUT --data b ""http://10.0.1.1:26551/uri/$FILE_CAP?offset=0""
}}}
The file now contains 'b', while I would expect 'ba'."	defect	new	normal	undecided	unknown	n/a				
