|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hello,
I’m trying to tranform an application that now is using filesystem functions, such as: fread,fwrite, fputs, move_uploaded_file, etc… in an application based on ftp functions, to make it more affordable file permissions management on the web server.Usually, filesystem function write files on file system as nobody user.I’m changing this by using ftp functions to write file as <owner user>.What I need is to find a corrispondence for fwrite or Fputs.In other words, I need an ftp function that take in input a string variable (as fwrite) and write it as a new file on the server. Thanks for help Claudia
__________________
Anna Claudia |
|
#2
|
||||
|
||||
|
look up the ftp functions on php.net.
you will probably have to write yourself a little function that writes to a temp text file normally and then uploads it to the server as 'owner' and then deletes the temp file. This is a very long winded way of doing things though. Arte you sure there is no way to change the file's ownership directly? I have not tried it befor eso I don't know. Hope this helps.
__________________
|
|
#3
|
||||
|
||||
|
Just looked myself and found this in about 30 seconds:
chown() - "Attempts to change the owner of the file filename to user user (specified by name or number). Only the superuser may change the owner of a file." Although that last bit makes it look like it might not work on all servers. I don't know what user php runs under on your server but I'm guessing it's not root so it sounds like this won't work. Let us know how you get on. Last edited by banks : April 26th, 2004 at 05:12 PM. |
|
#4
|
||||
|
||||
|
Does this help?
Quote:
|
|
#5
|
|||
|
|||
|
What I should need is an ftp function, instead of :
PHP Code:
Web Server runs as NOBODY, so the file $news will be written as NOBODY USer. I force 777 to make it readable also from my FTP User. Last edited by acp : April 28th, 2004 at 10:20 AM. |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Writing strings using FTP functions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|