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

Reply via email to