Thank you - exactly what I was after. The only variation I needed (perhaps 
because I was working in Windows at the time?) was for the add/update script 
where I needed to enclose the final URL from $FEDORA_WEBROOT to $FILE_MIMETYPE 
in "double quote marks".
Thanks again for rescuing me from confusion.
- - - - -
# Richard Higgins
# Durham University Library
# Archives & Special Collections
# Palace Green
# Durham
# DH1 3RN
# E-Mail: [email protected] 

-----Original Message-----
From: Ben Ranker [mailto:[email protected]] 
Sent: 19 August 2009 15:05
To: HIGGINS R.I.
Cc: [email protected]
Subject: Re: [Fedora-commons-users] modifying or purging existingdatastreams 
using curl

Quoth Richard Higgins on Wed, Aug 19, 2009 at 08:23:50AM -0400:
> Please can anybody provide me with a few working examples of command 
> line methods of modifying and purging existing datastreams using curl.

Here’s what I use to add and delete datastreams from the command line, using 
the REST API on Fedora 3.2.1:

To delete a datastream:
curl -u $FEDORA_USER:$FEDORA_PASS -X DELETE 
$FEDORA_WEBROOT/objects/$PID/datastreams/$DS

To add/update a datastream:
curl -F fi...@$filename -u $FEDORA_USER:$FEDORA_PASS 
$FEDORA_WEBROOT/objects/$PID/datastreams/$DS?controlGroup=M&checksumType=MD5&mimeType=$FILE_MIMETYPE

Fill in variables appropriate to your environment and what you want to edit, of 
course. FEDORA_WEBROOT for my test installation is http://localhost:8080/fedora 
.

HTH.

--
Ben Ranker <[email protected]>
Emory University Libraries
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to