Indigo Rose Software
  #1  
Old 05-24-2005
Skyluke Skyluke is offline
Indigo Rose Customer
 
Join Date: May 2005
Posts: 5
URL spaces

Hello all!! I'm a new user of TrueUpdate and i've a question for you:
I have to download multiple files from an FTP site. Some file has spaces in the name (like "hello all.exe") and the FTPWI library automatically convert it into "ftp://myserver/hello%20all.exe". Our web server does not recognize the "%20" in the name, and return an error code. Can i customize the FTPWI library so it don't convert the spaces into "%20"?
  #2  
Old 05-25-2005
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Hi Skyluke,

I have been looking into this and it appears as though encoding spaces in an FTP URL using %20 is an error, this bug will be fixed for the next release of TrueUpdate 2.0.

In the mean time you can get around this problem by uploading the file to your FTP server without a space, and then using FTPWI to download the file to your users hard drive with a space. For example:

Code:
FTPWI.Download("ftp://myserver/helloall.exe", "C:\\downloads\\hello all.exe", "user", "password");
__________________
MSI Factory The Next Generation Intelligent Setup Builder
  #3  
Old 05-26-2005
Skyluke Skyluke is offline
Indigo Rose Customer
 
Join Date: May 2005
Posts: 5
Quote:
Originally Posted by Mark
Hi Skyluke,

I have been looking into this and it appears as though encoding spaces in an FTP URL using %20 is an error, this bug will be fixed for the next release of TrueUpdate 2.0.

In the mean time you can get around this problem by uploading the file to your FTP server without a space, and then using FTPWI to download the file to your users hard drive with a space. For example:

Code:
FTPWI.Download("ftp://myserver/helloall.exe", "C:\\downloads\\hello all.exe", "user", "password");
Many thanks for the suggestion!! I've also a second question for you :PP My updated files are in the same FTP site of the TrueUpdate Server script. We have 2 FTP server, actually. Is it possible to know inside of the server script, from wich server i've downloaded the script? For example:
Server1 = 192.168.1.1 (our LAN server
Server2 = 81.208.xxx.xxx

Obviously our customers can't connect to 192.168.1.1 so I need something that inform the server script that i'm connecting to 81.208.xxx.xxx !!

Thanks again for your help!!
  #4  
Old 05-27-2005
Mark's Avatar
Mark Mark is offline
Indigo Rose Staff Member
 
Join Date: Jun 2000
Location: Indigo Rose Software
Posts: 1,773
Hi Skyluke,

Yes it is possible to know which server script you have downloaded. If you have used the project wizard to create your project then you will be able to check the value of: screen_globals.CurrentServerIndex right after the line:

Code:
if(Screen.Show("Connect to Server") == SR_SUCCESS) then
screen_globals.CurrentServerIndex will be a numeric index into the table of TrueUpdate servers returned by TrueUpdate.GetUpdateServerList(). Which is a numerically indexed table containing the Name/IDs of the TrueUpdate Servers published to the client.

So if you have Server1 and Server2 you would be able to tell which server file was being used by using the following code:

Code:
-- Download and run the server script
if(Screen.Show("Connect to Server") == SR_SUCCESS) then
	-- Get the list of TrueUpdate Server locations
	local tableTrueUpdateServers = TrueUpdate.GetUpdateServerList();
	if(tableTrueUpdateServers) then
		strServerName = tableTrueUpdateServers[screen_globals.CurrentServerIndex];
		if (strServerName=="Server1") then
			--Server 1
		elseif (strServerName=="Server2") then
			--server 2
		end
	end
	TrueUpdate.RunScript("Server Script");
end
Alternatively you can also edit your Download Server Screen directly to keep track of the index and name of the server file used.
__________________
MSI Factory The Next Generation Intelligent Setup Builder
  #5  
Old 05-27-2005
Skyluke Skyluke is offline
Indigo Rose Customer
 
Join Date: May 2005
Posts: 5
Many many thanks! I did it in a similiar way: I've added 2 scripts called "Location1" and "Location2", each configures the FTP variables to connect with the correct server, and i used the CurrentServerIndex to launch the appropriate script!

Thanks 4all!!
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetURLFilename script, how to use spaces in URL's gnetcanada AutoPlay Media Studio 5.0 3 07-21-2004 02:57 PM
Function: Get Filename from URL Brett AutoPlay Media Studio 5.0 Examples 0 05-31-2004 03:46 PM
Pass URL to Browser Tux AutoPlay Media Studio 5.0 1 04-06-2004 12:38 AM
HOW TO: Return a Web Browser Object to the Original URL after a Page Jump Support AutoPlay Media Studio 4.0 Examples 0 02-03-2003 10:18 AM
HOWTO: Open an Internet URL in the Default Web Browser Support AutoPlay Media Studio 4.0 Examples 0 09-18-2002 02:59 PM


All times are GMT -6. The time now is 09:13 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software