Bug 134489

Summary: kget downloading files from dynamic php pages get wrong names for files
Product: [Applications] kget Reporter: Sebastian Turzański <dpbasti>
Component: generalAssignee: KGet authors <kget>
Status: RESOLVED FIXED    
Severity: normal CC: chok
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Sebastian Turzański 2006-09-22 09:22:19 UTC
Version:           v0.8.5 (using KDE 3.5.4 "release 71.1" , openSUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.21-0.21-smp

for example when i try to download http://files.complex-microcosm.com/index.php?option=com_docman&task=doc_download&gid=82 the name it suggests is index.html but the name of the file is different. It oshuld not be taken from URL
Comment 1 Carsten Pfeiffer 2006-09-25 13:16:50 UTC
Does anyone have a different URL where this happens? The above one doesn't seem to trigger a download for me.
Comment 2 Carsten Pfeiffer 2006-09-25 13:28:42 UTC
OK, it does work if you press the download button on the page you get (a measure to prevent direct downloads from other sites).
Comment 3 Carsten Pfeiffer 2006-09-25 13:37:19 UTC
SVN commit 588225 by pfeiffer:

Show the right filename for dynamic download things
BUG: 134489


 M  +6 -6      main.cpp  


--- branches/KDE/3.5/kdenetwork/kget/main.cpp #588224:588225
@@ -168,19 +168,19 @@
         else if(args->count()>=2)
 		{
 			KURL::List urls;
-			QString dest;
 			for( int i=0; i < args->count(); ++i){
 				urls.append(KURL::fromPathOrURL( args->arg(i)));
 			}
 			
-			// Sometimes valid filenames are not recognised by KURL::isLocalFile(), they are marked as unvalid then
-			if ( args->count()==2 & ( urls.last().isLocalFile() | !urls.last().isValid()))
+			// Sometimes valid filenames are not recognised by KURL::isLocalFile(), they are marked as invalid then
+			if ( args->count()==2 && ( urls.last().isLocalFile() || !urls.last().isValid()))
 			{
-				dest=urls.last().path();
-				kmain->addTransferEx( urls.first(), dest );
+				kmain->addTransferEx( urls.first(), urls.last() );
 			}
 			else
-				kmain->addTransfers( urls, dest );
+			{
+				kmain->addTransfers( urls, QString() );
+			}
 		}
         args->clear();
 
Comment 4 Mamy Ratsimbazafy 2008-10-24 21:57:14 UTC
I have the same problems
when calling kget through opera or command line, the filename is not right if the link is dynamic.
Kget correctly resolves name if called by Konqueror though

Kget version 2.1.1 from kdemod (kdemod-core/kdemod-kdenetwork-kget 4.1.2-1)