Hello Thierry,

I played around with that but i didn't find a solution that fits my  
needs.

I just want to be able to upload _any_ type of file to the Directory  
Object.
Eg.:
myPDF.pdf
myTXT.txt
myOwnFormat.asdf
myFileWithoutExtension

I succeed with the first two, but what about the last two. There is no  
MimeType for that registered and so is no MediaType.
Is there a way to achieve this i am not able to see, or is it just not  
supported.

Thank you.

Best regards,
Christian Haintz


On Mar 7, 2009, at 8:53 AM, Thierry Boileau wrote:

> Hello Christian,
>
> there is a mechanism based on the MetadaService [1] that checks the
> media type of the uploaded file with the one deduced from the URI of  
> the
> resource.
> For instance, you put a file with mediatype */* on a URI such as
> http://www.example.com/fille.txt.
> Based on the metadata service, the media type of the resource is
> "text/plain".
>
> The rule is : if */* is not included into "text/plain" then, reject  
> the
> uploaded representation. it avoid to send a binary file when a text  
> file
> is expected.
>
> Having said that, this mechanism could be optional, it isn't.
>
> best regards,
> Thierry Boileau
>
>> Hi,
>>
>> I simply wanna upload a File to the org.restlet.Directory. But all I
>> get is:
>>
>> See Other (303) - The metadata are not consistent with the URI
>>
>> I don't know what that means, or what I can do against it.
>>
>> On the Server Side i do:
>> Application application = new Application() {
>>
>>             @Override
>>             public Restlet createRoot() {
>>
>>                 Directory dir = new Directory(getContext(),  
>> ROOT_URI);
>>                 dir.setModifiable(true);
>>                 dir.setDeeplyAccessible(true);
>>
>>                 return dir;
>>
>>             }
>>         };
>>         return application;
>>
>> And the client which is uploading a file looks:
>>
>> Client client = new Client(Protocol.HTTP);
>> Representation rep = new FileRepresentation(fileOpt.getValue(),
>> MediaType.ALL);
>> Response response = client.put(reference, rep);
>>
>> Any suggestions?
>>
>> Thx,
>> christian
>>
>> --
>> Christian Haintz
>> Student of Software Development and Business Management
>> Graz, University of Technology
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1279726
>>
>>
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1281460

--
Christian Haintz
Student of Software Development and Business Management
Graz, University of Technology

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1288592

Reply via email to