Bug 164422

Summary: kget download from php with bad name
Product: [Applications] kget Reporter: giuseppe <metrobotte>
Component: generalAssignee: KGet authors <kget>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description giuseppe 2008-06-19 00:51:21 UTC
Version:           2.0.83 (using 4.00.83 (KDE 4.0.83 (KDE 4.1 Beta2), compiled sources)
Compiler:          gcc
OS:                Linux (i686) release 2.6.24.5-smp

http://www.mytux.org/include/download.inc.php?id=250&type=src

File must be saved as system-status.tar.bz2
kget save it as download.inc.php
Comment 1 Ningyu Shi 2008-06-19 01:21:46 UTC
This bug needs some work, namely KIO(or any other transfer-plugin) should have the ability to change the filename according to the server side if the user don't supply one(only assign the directory). An directoryOnly option may be add to KGet::createTransfer() like KGet::createTransfer(KUrl srcUrl, KUrl destUrl, const QString& groupName, bool start, bool directoryOnly=false). Then the plugin can determine the filename itself. Notice that, if we do so, the way to check duplicate transfer in m_transferTreeModel also need to be modified to check duplication only when directoryOnly==false.
Comment 2 Lukas Appelhans 2008-06-19 10:53:02 UTC
Well, not imo, we need to know how the Filename will when initializing the NewTransferDialog, cause there, the user _can_ change the filename...

Lukas

PS: I have no clue how to implement this, but probably a TransferFactory::suggestedFilename(const KUrl &url); is necessary?
Comment 3 Ningyu Shi 2008-06-19 16:59:47 UTC
I just reproduce the bug, if I type the filename 'system-status.tar.bz2' in the Destination input, it's fine. But If I only specify the directory there, KGet will download it as download.inc.php. But quite often, user won't bother specify the filename, or they simply don't know, the server will always return a filename anyway. I've seen this behavior in some popular downloaders.
Comment 4 giuseppe 2008-06-19 18:20:36 UTC
Kget3 works fine..without
specify the name.
Comment 5 Carsten Pfeiffer 2008-06-19 21:10:04 UTC
Am Donnerstag, 19. Juni 2008 schrieb giuseppe:
> ------- Kget3 works fine..without specify the name.


Yes. Konqueror passed the server-specified filename as an additional parameter 
to kget. (You get the filename from KIO's metadata IIRC).
Comment 6 Lukas Appelhans 2008-06-19 21:33:54 UTC
Actually we have that passing from Konqueror as well...
I think the reporter uses another Browser and/or pasts directly to the NewTransferDialog...

Lukas
Comment 7 giuseppe 2008-06-28 03:39:56 UTC
Solved on konqueor 4.00.84