Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 859 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
ftp_download #450873
04/24/15 06:24
04/24/15 06:24
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
There isn't much documentation in the manual about this. I tried to use the example with my own credentials, and it doesnt work, although Im certain it should.

Im entering the same info id use to log into filezilla.
Can you please help me in the right direction?

Code:
ftp_download("ftp//:www.host.com/model.mdl", "models/model.mdl", "USER", "PASSWORD");

	while (!ftp_status()) //as long as the download is running
	{ //get informations about the download:
		fsize = ftp_size();
		fsent = ftp_sent();
		wait(1);
	} 
	if (ftp_status() == 1) 
	printf("Download successful!"); 
	else 
	printf("Error during download!");



Thank you for your time.

Last edited by DLively; 04/24/15 08:20.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: ftp_download [Re: DLively] #450883
04/24/15 10:48
04/24/15 10:48
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I see a syntax error in the URL, and also I'm suspicious about "models/model.mdl" - better give an absolute path.

Re: ftp_download [Re: jcl] #450887
04/24/15 12:56
04/24/15 12:56
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Thanks for your reply Jcl,

yeah.. [face palm] I noticed the Url was wrong after I posted my question.. I thought I updated that.

I tried using an absolute path, and with no luck im still getting "error during download"
ftp_size becomes -1, and ftp_sent stays at 0.

Here is the updated code:
Code:
#define ADDRESS "ftp://www.host.com/model.mdl"
#define _PATH "E:/projectfolder/models/model.mdl"
#define USER "filezilla_user"
#define PASS "filezilla_pass"

void update_game(){
	ftp_debug(1);

	ftp_download(ADDRESS, _PATH, USER, PASS);
	while (!ftp_status()) //as long as the download is running
	{ //get informations about the download:
		fsize = ftp_size();
		fsent = ftp_sent();
		DEBUG_VAR(fsize, 100);
		DEBUG_VAR(fsent, 120);
		wait(1);
	} 
	if (ftp_status() == 1) 
	printf("Download successful!"); 
	else 
	printf("Error during download!"); 
}

function main(){

	update_game();
	wait_for(update_game);
        ...
}


Last edited by DLively; 04/24/15 13:13.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: ftp_download [Re: DLively] #450888
04/24/15 13:08
04/24/15 13:08
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Just a quick update.

I have access to two servers, and with their proper credentials entered, neither one produce any more or less of a result.


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: ftp_download [Re: DLively] #450889
04/24/15 13:17
04/24/15 13:17
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
I got the ftp_log to work, however there is content that I trust only in your Pm's...

Pm sent laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: ftp_download [Re: DLively] #450913
04/24/15 16:21
04/24/15 16:21
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Better contact Support - as a Pro user you have 12 months support. I suspect that the problem might be related to the folder structure or usage rights of your ftp server, but the support can look into your logs and tell you for sure.

Re: ftp_download [Re: jcl] #450914
04/24/15 17:07
04/24/15 17:07
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Unfortunately, I purchased my Professional Licence Used -- Furthermore, I purchased it used over a year ago.

Both ftp logs are the same -> Everything works fine and its connecting to the server, however it appears that it is having trouble downloading the file I am requesting, because it does register that I am looking for the entered file. But apparently it can't find that file..


Code:
> TYPE I

< 200 TYPE is now 8-bit binary

> SIZE hero.mdl

< 550 Can't check for file existence

> RETR hero.mdl

< 550 Can't open hero.mdl: No such file or directory

* RETR response: 550
* Remembering we are in dir ""
* Connection #0 to host www.devonlively.com left intact
* Remote file not found
> QUIT

< 221-Goodbye. You uploaded 0 and downloaded 0 kbytes.

< 221 Logout.

* Closing connection #0



Hopefully Someone can fill in the blanks from here for me..

Last edited by DLively; 04/24/15 17:12.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: ftp_download [Re: DLively] #450928
04/24/15 23:09
04/24/15 23:09
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Stop using 3DGS stuff and use WinAPI combined with Winsock2.
Takes 10 mins to implement it to a new project and add it as plugin to your game. Google is full of results on how to download a file with it from a remote server

Last edited by Ch40zzC0d3r; 04/24/15 23:09.
Re: ftp_download [Re: Ch40zzC0d3r] #450936
04/25/15 05:32
04/25/15 05:32
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
can you recommend a tutorial for me to start with? Im looking, and Im learning, but it would be nice to be turned in the right direction, as i feel I am walking around with a blindfold on...


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: ftp_download [Re: DLively] #450937
04/25/15 05:42
04/25/15 05:42
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Code:
////////////////////////////////////////////////////////////////////////////////
// lite-c header for http / ftp functions
// (c) 2009 Peter Soxberger / oP group Germany
////////////////////////////////////////////////////////////////////////////////

#ifndef ACKNET_H
#define ACKNET_H

#define PRAGMA_BIND "acknet.dll";

var http_proxy(char* proxy,var port);

var http_sendpost(char* url, char* data);

var http_status(var httpid);

var http_result(var httpid, STRING* result);

var http_free(var httpid);


var ftp_download(char* url, char* path, char* username, char* password);

var ftp_upload(char* url, char* path, char* username, char* password);

var ftp_getdate(char* url, char* username, char* password);

void ftp_stop();

long ftp_size();

long ftp_sent();

long ftp_timestamp();

var ftp_status();

var ftp_debug(var mode);

#endif



How is this being taken from the dll?
// - using this as an example, I don't understand.
Code:
public class HttpRemoteDownload : RemoteDownload
    {
        public HttpRemoteDownload(string urlString, string descFilePath)
            : base(urlString, descFilePath)
        {
 
        }
 
        public override bool DownloadFile()
        {
            string fileName = System.IO.Path.GetFileName(this.UrlString);
            string descFilePathAndName =
                System.IO.Path.Combine(this.DescFilePath, fileName);
            try
            {
                WebRequest myre = WebRequest.Create(this.UrlString);
            }
            catch
            {
                return false;
            }
            try
            {
                byte[] fileData;
                using (WebClient client = new WebClient())
                {
                    fileData = client.DownloadData(this.UrlString);
                }
                using (FileStream fs =
                      new FileStream(descFilePathAndName, FileMode.OpenOrCreate))
                {
                    fs.Write(fileData, 0, fileData.Length);
                }
                return true;
            }
            catch (Exception ex)
            {
                throw new Exception("download field", ex.InnerException);
            }
        }
    }
 
public class FtpRemoteDownload : RemoteDownload
    {
        public FtpRemoteDownload(string urlString, string descFilePath)
            : base(urlString, descFilePath)
        {
 
        }
 
        public override bool DownloadFile()
        {
            FtpWebRequest reqFTP;
 
            string fileName = System.IO.Path.GetFileName(this.UrlString);
            string descFilePathAndName =
                System.IO.Path.Combine(this.DescFilePath, fileName);
 
            try
            {
 
                reqFTP = (FtpWebRequest)FtpWebRequest.Create(this.UrlString);
                reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
                reqFTP.UseBinary = true;
                
 
                using (FileStream outputStream = new FileStream(descFilePathAndName, FileMode.OpenOrCreate))
                using (FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse())
                using (Stream ftpStream = response.GetResponseStream())
                {
                    int bufferSize = 2048;
                    int readCount;
                    byte[] buffer = new byte[bufferSize];
                    readCount = ftpStream.Read(buffer, 0, bufferSize);
                    while (readCount > 0)
                    {
                        outputStream.Write(buffer, 0, readCount);
                        readCount = ftpStream.Read(buffer, 0, bufferSize);
                    }
                }
                return true;
            }
 
            catch (Exception ex)
            {
                throw new Exception("upload failed", ex.InnerException);
            }
        }
    }



A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Page 1 of 4 1 2 3 4

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1