Link to home
Start Free TrialLog in
Avatar of DennisWood
DennisWood

asked on

chmod with CInternetFile or CFTPConnection

Hello,

I'm transfering files with help of the MFC-Classes CInternetConnection and CFTPConnection. The problem is that the files does not have enough permissions on the target server. I can not find any methode to change the file permissions. Is there any other way ? I did not find a methode for permissions within the CInternetFile, too.

What could I do ?
Avatar of aquila98
aquila98

What do you mean change permissions???
The files sould take the default permission of the shell
(if you're in unix) which is set with the umask command...

You want to setuided the files so that there executed by a
admin account or someting like that os a remote system???
On a windoze marchine or a unix one?


Avatar of DennisWood

ASKER

I mean the unix file access permissions on the linux-ftp-server. In usual ftp-clients it is possible to transfer a file to a ftp server and then change the permissions, e.g. to rw-rw-rw- (666).

I don't want to change anything on the ftp-server !

The "client" I write under windoze with the MFC
So If I understand correctly...
A windoze client upload a file on a unix ftp server.
But it turns out that the dile on the unix machine has the
wrong file permission (like 444) and you are wondering how to
chmod the file from the client side AFTER it has been uploaded...

I think once the file has been transfered from the client it is too late...

Several options are available on the unix side...
a cron job which chmod all file in the upload area at regular
interval seems the simplest...


Avatar of DanRollins
>>I don't want to change anything on the ftp-server !

If you want to change the file permissions on the server, then how can this be true?  Perhaps you need to provide mpore information.  Are you talking about downloading files from the server or uploading files to it?

-- Dan
I'm talking about uploading.
It would be enough to give the file the correct permissions, e.g. 444, in the moment I upload it.
Wouldn't allowing the client to set the permissions be a serious security breach?  For instance, if the server was set to disallow execution, then if the client were to be allowed to simply override that setting... well, it makes me shudder.  Even something as simple as allowing the client to change a read-only file to a read-write could be disasterous.

-- Dan
ASKER CERTIFIED SOLUTION
Avatar of aquila98
aquila98

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial