Delphi-PRAXiS
Seite 2 von 3     12 3      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Datei (herauf)laden bei nem FTP (https://www.delphipraxis.net/73472-datei-herauf-laden-bei-nem-ftp.html)

toredo 18. Jul 2006 22:06

Re: Datei (herauf)laden bei nem FTP
 
hay,

hier ist ein fehler drin aber wo?
Delphi-Quellcode:
putfile('85.10.200.141', 'tjo', 'lol', 'D:\Bally.exe', '\html\Bally.exe')

mfG toredo

Luckie 18. Jul 2006 22:15

Re: Datei (herauf)laden bei nem FTP
 
Zitat:

Zitat von toredo
hay,

hier ist ein fehler drin aber wo?
Delphi-Quellcode:
putfile('85.10.200.141', 'tjo', 'lol', 'D:\Bally.exe', '\html\Bally.exe')

Woher weißt du, dass da ein Fehler drinne ist?

toredo 18. Jul 2006 22:18

Re: Datei (herauf)laden bei nem FTP
 
ich hab einfach mal ein project gemacht und dann nen button gemacht bei dem habe ich dann diese zeile eingefügt und halt noch die function oben.
dann hab ich auch auf den knopf gedrückt und irgendwas war am laden für etwa zwei sekunden und dann hab ich auf dem ftp nachgeschaut ob was passiert ist, aber die datei war nicht oben...



mfG toredo

ErazerZ 18. Jul 2006 23:07

Re: Datei (herauf)laden bei nem FTP
 
Zitat:

Zitat von capo
hi

was bedeutet?
Delphi-Quellcode:
InternetOpen('myagent', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);
gruss, capo

Zitat:

InternetOpen

Initialises the WinInet API.

function InternetOpen(
lpszAgent: PChar;
dwAccessType: DWORD;
lpszProxy: PChar;
lpszProxyBypass: PChar;
dwFlags: DWORD): HINTERNET;

Parameters:

lpszAgent
Name of the calling application (for example 'PChar(Application.Title)'). This is used as the user agent for HTTP protocol.

dwAccessType
Access type required, use one of:

INTERNET_OPEN_TYPE_DIRECT
Resolve all host names locally.

INTERNET_OPEN_TYPE_PRECONFIG
Retrieve proxy or direct configuration from the registry.

INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY
Retrieves proxy or direct configuration from the registry and prevents the use of any start-up script.

INTERNET_OPEN_TYPE_PROXY
Requests passed on to the proxy. If a proxy bypass list is supplied and the name is on that list then INTERNET_OPEN_TYPE_DIRECT is used instead.

lpszProxy
If dwAccessType is set to INTERNET_OPEN_TYPE_PROXY then this should be the name of the proxy server(s) to use. WinInet API functions recognise only CERN type proxies (HTTP only) and TIS FTP gateway (FTP only). If Internet Explorer is installed then SOCKS proxy are also supported. For all other values of dwAccessType this should be set to nil.

lpszProxyBypass
String containing an optional list of host names or IP addresses, which should not be routed through the proxy. If dwAccessType is not INTERNET_OPEN_TYPE_PROXY then this parameter is ignored and should be set to nil.

dwFlags
Various configuration options. Use one or more of:

INTERNET_FLAG_ASYNC
Makes only asynchronous requests.

INTERNET_FLAG_FROM_CACHE
All entries are returned from the local cache. Requests will fail if the item is not in the local cache.

INTERNET_FLAG_OFFLINE
Same as INTERNET_FLAG_FROM_CACHE

Returns: Handle for use with the other WinInet API functions or nil if the function fails in which case details of the specific error can be found by calling GetLastError().

Note:

* InternetOpen should be the first WinInet API function called by the application.
* When the application finishes using the WinInet API it should call InternetCloseHandle to free the handle and any associated resources.
* Applications may make more than one call to InternetOpen (although only one is required).
und toredo ich glaub vielleicht ist dein login falsch? oder der ordner existiert nicht oder pfad ist ungültig?

toredo 19. Jul 2006 09:44

Re: Datei (herauf)laden bei nem FTP
 
[quote="ErazerZ"]
Zitat:

Zitat von capo
und toredo ich glaub vielleicht ist dein login falsch? oder der ordner existiert nicht oder pfad ist ungültig?

sollte eigentlich alles stimmen:
Delphi-Quellcode:
putfile('85.10.200.141', 'tjo', 'lol', 'D:\Bally.exe', '\html\Bally.exe')
die ip stimmt 100%ig, benutzername und pw hab ich auch, ich kann mich mit diesem zeug auch mit jedem ftp-clienten einloggen. und die datei D:\Bally.exe exestiert natürlich auch.
und auf dem ftp sind halt so verschiedene ordner: backup, atd, files, html...
und wenn ich dateien rauflade muss ich die ja in den html-ordner reinmachen aber hier klappts irgendwie nicht, weil die datei will einfach nicht da rein...




mfG toredo

Klaus01 19. Jul 2006 10:41

Re: Datei (herauf)laden bei nem FTP
 
ist der Server vielleicht eine Linux/Unix Box?

Dann kannst Du mal '/html/Bally.exe' probieren.

Grüße
Klaus

toredo 19. Jul 2006 11:09

Re: Datei (herauf)laden bei nem FTP
 
thx, jetzt klappt es :-D
gibt es auch ne getfile-function die etwa gleich aufgebaut ist?


mfG toredo

ErazerZ 19. Jul 2006 11:50

Re: Datei (herauf)laden bei nem FTP
 
ja, FtpPutFile mit FtpGetFile verändern ..
Delphi-Quellcode:
function FtpGetFile(
    hConnect: HINTERNET;
    lpszRemoteFile: PChar;
    lpszNewFile: PChar;
    fFailIfExists: BOOL;
    dwFlagsAndAttributes: DWORD;
    dwFlags: DWORD;
    dwContext: DWORD): BOOL

toredo 19. Jul 2006 15:46

Re: Datei (herauf)laden bei nem FTP
 
war eigentlich ne dumme frage...

danke für die hilfe :-D


mfG toredo

capo 19. Jul 2006 16:02

Re: Datei (herauf)laden bei nem FTP
 
@ErazerZ

danke für deine erklärungen

capo


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:28 Uhr.
Seite 2 von 3     12 3      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz