Bug 134489 - kget downloading files from dynamic php pages get wrong names for files
Summary: kget downloading files from dynamic php pages get wrong names for files
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-22 09:22 UTC by Sebastian Turzański
Modified: 2008-10-24 21:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)