[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| Re: [ecf-dev] File name of retrieved file | 
Hi Thomas,
Thomas Hallgren wrote:
When obtaining a file from a remote source it is often good to know 
the intended filename. It might be used in progress reporting and 
sometimes also as a source of information when naming the resulting 
local file.
The URL in itself is sometimes very cryptic and the path might contain 
a name in some numeric form (calculated UUID perhaps). In some cases, 
the path doesn't contain a name at all (ends with download.php for 
instance) and the actual path is hidden in one of the parameters. When 
using HTTP, the returned "Content-Disposition" response header field 
is often a much better source for the filename the the actual URL.
Using ECF, I cannot obtain this header field and that's OK. There's a 
lot of transfer implementations where use of response headers isn't 
applicable. I would however like a 
IIncomingFileTransfer.getRemoteFileName() method. The HTTP transfer 
could use the Content-Disposition and other file transfer 
implementation could do a best effort based on whatever algorithm that 
would be appropriate for them. I'm attaching the code that Buckminster 
uses to extract the file name from the Content-Disposition header below.
What do you think? Could something like this be make available in ECF 
incoming file transfer?
Sure.  Please open an enhancement request and we'll get it in this week.
Scott