Bernd,
Slide's WebDAV client creates a lock-null resource when you lock a file that
doesn't exist and that you want to create. This is how the WebDAV standard
deals with two uploads of the same new file at the same time. When the
second server tries to lock the resource they will be denied with the 423
error code. So you don't need a temp file (I don't think) as the WebDAV
server creates it for you.
So to do what you want and assuming that all of your clients that are doing
uploads simultaneously will be your DAV clients then you need to:
0) Check whether the file already exists on the file server.
If yes => done
1) Call webdav client lockMethod on target file (creates lock-null
resource)
2) Call webdav client putMethod to upload bytes to the lock-null
file.
4) Unlock the lock with webdav client unlockMethod on target file.
Try this approach and you should not see the 423 error you're seeing now --
at least if you're using the Slide 2.1 WebDAV client which I am using and
which passes the lock to the server in the request as it is supposed to.
Warwick
> -----Original Message-----
> From: Bernd K�hl [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 07, 2004 9:34 AM
> To: Slide Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: WebDav LOCK and MOVE question
>
>
> Hello,
>
> Yes I have a problem with the move. Please find attached a
> simple test program. The output of the program is
>
> Empty put temp file status is 201, result is true
> Put temp file status is 201, result is true
> lock temp file status is 200, result is true
> Put temp file status is 423, result is false
> Move status is 201, result is true
> unlock status is 204, result is true
>
> As you see I get a 423 error status code for the move. Apache logged:
>
> [Tue Dec 07 16:30:42 2004] [error] [client 172.16.8.1] This
> resource is locked and an "If:" header was not supplied to
> allow access to the resource. [423, #0]
>
> I do not understand why no (or the wrong) If: is supplied to
> the move request.
>
> Who can help me?
>
> Thx,
>
> Bernd
>
>
> > -----Original Message-----
> > From: Oliver Zeigermann [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, December 07, 2004 4:18 PM
> > To: Slide Users Mailing List
> > Subject: Re: WebDav LOCK and MOVE question
> >
> > So, you still could has a problem while moving the temporary file.
> >
> > Bottom line: You try to reimplement transactional features
> modav does
> > not seem to have. Maybe then it is not the right choice in
> the first
> > place.
> >
> > Oliver
> >
> >
> > On Tue, 7 Dec 2004 16:06:49 +0100, Bernd K�hl
> > <[EMAIL PROTECTED]>
> > wrote:
> > > Hello,
> > >
> > > It is "Apache/2.0.44 (Unix) DAV/2 mod_webapp/1.2.0-dev".
> > >
> > > Just uploading the file is not good enough since then different
> > > server
> > machines can do the upload in parallel. Moreover a client
> machine can
> > fetch the file while a [slow] server machine is currently doing the
> > upload. This leads into a corrupted file.
> > >
> > > Thx,
> > >
> > > Bernd
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Oliver Zeigermann [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, December 07, 2004 3:47 PM
> > > > To: Slide Users Mailing List
> > > > Subject: Re: WebDav LOCK and MOVE question
> > > >
> > > > What is the WebDAV server you are programming to? Slide? If so,
> > > > just upload the file.
> > > >
> > > > Oliver
> > > >
> > > > On Tue, 7 Dec 2004 15:11:42 +0100, Bernd K�hl
> > <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > Hello,
> > > > >
> > > > > I want to upload a file to a web server. Several
> machines maybe
> > > > > try
> > in
> > > > parallel to upload the same file. Therefore locking is
> needed to
> > > > allow only one upload. Moreover I have to ensure that no other
> > > > machine
> > downloads
> > > > the file before the complete upload is done. So the algorithm I
> > > > have
> > in
> > > > mind goes like this:
> > > > >
> > > > > 0) Check whether the file already exists on the file
> server. If
> > > > > yes
> > =>
> > > > done
> > > > > 1) Lock non existing temporary file.
> > > > > 2) Upload the bytes to the locked temporary file.
> > > > > 3) Move the temporary file to the destination name.
> > > > > 4) Unlock the lock.
> > > > >
> > > > > Unfortunately it seems that I'm to dump and/or have not enough
> > knowledge
> > > > about WebDay and the slide WebDav client library to
> implement the
> > > > algorithm. Who is able to help me?
> > > > >
> > > > > Thx!
> > > > >
> > > > > Bernd
> > > > >
> > > > > --
> > > > > Bernd Wellh�fer VerdiSoft GmbH
> > > > > Phone: +49 40 280054-24 S�derstra�e 77
> > > > > Fax: +49 40 280054-50 20097 Hamburg
> > > > > Email: [EMAIL PROTECTED] Germany
> > > > >
> > > > >
> ----------------------------------------------------------------
> > > > > ----
> > -
> > > > > To unsubscribe, e-mail:
> > > > > [EMAIL PROTECTED]
> > > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> ------------------------------------------------------------------
> > > > ---
> > > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]