On Mon, May 3, 2010 at 4:42 PM, Hiranya Jayathilaka <[email protected]>wrote:
> > > On Mon, May 3, 2010 at 4:24 PM, Rajika Kumarasiri <[email protected]> wrote: > >> >> >> On Mon, May 3, 2010 at 4:15 PM, Hiranya Jayathilaka <[email protected] >> > wrote: >> >>> Rajika, >>> >>> On Mon, May 3, 2010 at 3:44 PM, Rajika Kumarasiri <[email protected]>wrote: >>> >>>> I'd like to hear your feedback before I provide you with a patch for the >>>> issue[1]. First it's an important improvement to vfs-transport. >>>> I think we can fix the problem by introducing an optional parameter for >>>> the vfs transport , "transport.vfs.TempFileName". >>> >>> >>> Why does the user has to specify this? >>> >> No, it should be an indicator ( a boolean) which suggest to use a temp >> file or not. >> > > Why? Writing to a temp file and then moving the file to the appropriate > place is the safest approach for handling file uploads. > Currently when uploading a file using the vfs transport sender it'll use the provided file name (as a part of the url) as the file name at the ftp server. As you can see this has a problem if one on the ftp server side starts to process the file at the same time since the file is not fully transferred. To avoid this we'll use a temporary file(if the user need a one) at the ftp server for uploading the file, once uploading is completed we can move that temp file to the original one. Rajika > > Thanks, > Hiranya > > >> >> Rajika >> >> >>> I think this behavior should be there by default in the transport. The >>> transport should figure out suitable names for temp files. Also I don't >>> think we can use a single name for all temp files. There could be situations >>> where multiple worker threads are trying to upload several files to the same >>> server. >>> >>> Thanks, >>> Hiranya >>> >>> >>>> If a user has provided this parameter we'll use this file on the remote >>>> server to upload the file. Once the upload is completed we will move the >>>> temporary file to the original file(which will delete the temp file). >>>> Comments? Suggestions? >>>> >>>> Rajika >>>> >>>> [1] - https://issues.apache.org/jira/browse/SYNAPSE-502 >>>> >>>> -- >>>> http://rajikak.blogspot.com/ >>>> >>> >>> >>> >>> -- >>> Hiranya Jayathilaka >>> Software Engineer; >>> WSO2 Inc.; http://wso2.org >>> E-mail: [email protected]; Mobile: +94 77 633 3491 >>> Blog: http://techfeast-hiranya.blogspot.com >>> >> >> >> >> -- >> http://rajikak.blogspot.com/ >> > > > > -- > Hiranya Jayathilaka > Software Engineer; > WSO2 Inc.; http://wso2.org > E-mail: [email protected]; Mobile: +94 77 633 3491 > Blog: http://techfeast-hiranya.blogspot.com > -- http://rajikak.blogspot.com/
