Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Apolyton/Community > Firefox Apolyton Download Issues
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
20.Sep: FOURTH CHAPTER IN `HISTORY OF...` PUBLISHED
13.Sep: NEWS ON THE FLY
06.Sep: APOLYTON DONATES TO HURRICANE RELIEF
CivGroups
Apolytoners Hall of Fame (66): Not a Member - Join

bottom of page
   - CIVILIZATION 3 $9.99 - CIVILIZATION 2 from $6.95 - CIVILIZATION 2 from $4.25 - ALPHA CENTAURI + ALIEN CROSSFIRE (laptop collection) from $19.99 - ALPHA CENTAURI PC $9.99 -->
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Atahualpa is offline Atahualpa
Emperor
Hawthrone
Mar 1999
time: 06:35
  Old Post 19-07-2004 18:26 Visit Atahualpa's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Firefox Apolyton Download Issues Increase Your PM Length

Whenever I download a file with spaces in its name from apolyton, it truncates all of the name after the first space and puts no extension to the name.

So when I download:

Blaha of the Romans 221 B.C.sav

then this will be downloaded to: Blaha and I manually have to add the ".sav" extension.

I have developed some php code that will do around this (mainly by replacing spaces with underscores).

Probably Markos could hack something like this into the forum?

PHP:
<?php
$wFile
= $_GET["file"];
if (!
$wFile) exit;

$fname = $_SERVER["DOCUMENT_ROOT"]."/".$wFile;

preg_match("/.*(..*)$/", $fname, $fname_ext);
switch(
$fname_ext)
{
    case
".jpg":
        
$content_type = "image/jpeg";
        break;
    case
".zip":
        
$content_type = "application/zip";
        break;
    case
".sav":
        
$content_type = "application/savegame";
        break;
    default:
        
$content_type = "";
}

$file = fopen($fname,"rb");  // open image for reading
if (!$file)
{
    echo
"Error: File does not exist";
    exit;
}
$fsize = filesize($fname);

if (
$content_type != "")
    
header("Content-Type: ".$content_type);
if (
preg_match("#Firefox#i",$_SERVER["HTTP_USER_AGENT"]))
{
    
$wFile = str_replace(" ","_",$wFile);
}
header("Content-Disposition: attachment; filename=".$wFile);
header("Content-Length: ".$fsize);

fpassthru($file);
fclose($file)
?>



Don't ask me why it puts an extra linebreak in every line...
Probably another thing Markos could quick-fix

MarkG is offline MarkG
Grand Lord of Apolyton, Owner of all this land as far as the eye can see

Donate to the Red Cross
Macedonia, Greece
Jan 1970
time: 07:35
  Old Post 19-07-2004 20:29 Visit MarkG<br><img src=/forums/images/admin-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Full PM-box? Change here!

fixed (without your code, but thanks anway )

Gerar Dean is offline Gerar Dean
Deity
Acá abajo
Sep 2002
time: 01:35
  Old Post 19-07-2004 21:02
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Full PM-box? Change here!

Well, this was one of the reasons for what I stop using Firefox

Anyway, now I'm using Maxthon (formerly MyIE2) and I'm happy

MarkG is offline MarkG
Grand Lord of Apolyton, Owner of all this land as far as the eye can see

Donate to the Red Cross
Macedonia, Greece
Jan 1970
time: 07:35
  Old Post 19-07-2004 21:24 Visit MarkG<br><img src=/forums/images/admin-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Call to Power 2

did you report the issue?

Atahualpa is offline Atahualpa
Emperor
Hawthrone
Mar 1999
time: 06:35
  Old Post 19-07-2004 23:02 Visit Atahualpa's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Lose 30 kilos (of popups)

good work
you even managed to preserve the spaces, how did you do that?

vovan is offline vovan
Emperor

Oct 2001
time: 06:35
  Old Post 19-07-2004 23:19
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton or Terrorists Win

Ooh, sweet. This has been bugging me for a while, but I never reported it. Thanks Mark!

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:35
  Old Post 20-07-2004 02:25
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by MarkG
did you report the issue?

I think I told you about it. Said that you didn't have the filename in quotes, and the Firefox didn't like that

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:35
  Old Post 20-07-2004 02:27
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Remove this text

quote:
Originally posted by Atahualpa
good work
you even managed to preserve the spaces, how did you do that?

My quess: Quote the filename string, it will at least work.

Gerar Dean is offline Gerar Dean
Deity
Acá abajo
Sep 2002
time: 01:35
  Old Post 20-07-2004 08:23
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Browse Apolyton AD-FREE

Well... I didn't report it. I just change my navigator

Atahualpa is offline Atahualpa
Emperor
Hawthrone
Mar 1999
time: 06:35
  Old Post 20-07-2004 14:03 Visit Atahualpa's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Full PM-box? Change here!

quote:
Originally posted by Gramphos

My quess: Quote the filename string, it will at least work.


I could've really come to that solution for myself

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:35
  Old Post 23-07-2004 09:45
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Lose 30 kilos (of popups)



A 4-letter word starts with "n" and ends with "b" springs into my head.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:35.
Apolyton Time is 00:35.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0501 seconds (91.08% PHP - 8.92% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net