Sign in to follow this  
smilleme

Upload file to server(internet HTTP)

Recommended Posts

Hi there! How can I upload file from my application to the server throught the internet. I used function InternetConnect and FtpPutFile, but function InternetConnect need name and password of the server. And it is very dangerous. Is any safet way to do it?

Share this post


Link to post
Share on other sites
I use InternetConnect(*) at work and I have never had a problem with it. I don't know what you mean by it not being safe or dangerous, but then again the server I connect to is on our network.

If you don't want to use the InternetConnect(*) function then you could always use WinSock to talk to the server.

Share this post


Link to post
Share on other sites
1) If you have access to the server, you could just set a new account for upload only.
2) You could then set a serverscript that takes a file from /tmp_uploads/ to /uploads/ after giving the file a unique name like ASUWE12391. Then the file would be stored at a 'secret place', abusers won't want that.

Share this post


Link to post
Share on other sites
Quote:
Original post by UltimaX
I use InternetConnect(*) at work and I have never had a problem with it. I don't know what you mean by it not being safe or dangerous, but then again the server I connect to is on our network.

If you don't want to use the InternetConnect(*) function then you could always use WinSock to talk to the server.


if i write this InternetConnect(hINet,"ftp.server.com",INTERNET_DEFAULT_FTP_PORT,"user","password",INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE,0);

Then someone who dissassemble or debug my application see user name and password.

Share this post


Link to post
Share on other sites
Quote:
Original post by smilleme
Quote:
Original post by UltimaX
I use InternetConnect(*) at work and I have never had a problem with it. I don't know what you mean by it not being safe or dangerous, but then again the server I connect to is on our network.

If you don't want to use the InternetConnect(*) function then you could always use WinSock to talk to the server.


if i write this InternetConnect(hINet,"ftp.server.com",INTERNET_DEFAULT_FTP_PORT,"user","password",INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE,0);

Then someone who dissassemble or debug my application see user name and password.


The one I wrote I set it up to where you have to put in the host, username, password, etc. Have you looked into WinSock or possibly just saving the username and password in an encrypted file?

Share this post


Link to post
Share on other sites
What exactly is it that makes you think your server will be broken into?Unless your writing a WoW or Diablo2( ;) ) no one will even care whats on your server. When I see threads like this one phrase always comes to mind... Delusions of grandeur...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this