Page 1 of 1

file access problems

Posted: Thu Sep 23, 2004 1:50 pm
by d52477001
Hello everyone,

Got a slight problem with writing to a file. I'll try to explain as clearly as i can:

I want to write some code to write to a file. I managed this without a problem using the fwrite() function. Now there are two places where i host files. One of them is on a server of someone i know. To connect to this i go through the ftp. here i changed the eccess rights of the file i wanted to write to and it worked without problem.
Now, there is a second place where i want to host this site. It's on the university network, so i do not use ftp, i just connect to the network and put files in a certain folder. Here, however, when i try to write to the file, i get a file access error. When i try to change the access rights, it is through the windows->properties dialog. Yet, even if i give full file premission, it still gives an access error.
So, i thought i was clever and i tried to write to the file on the 1st server i mentioned. Yet, then i get this error:

HTTP wrapper does not support writeable connections

So my question is, is there perhaps another way to change access rights so that i can write to the file on the university server, or is there perhaps another way i can write to a file.

Thanks very much in advance.

Djurre

Posted: Thu Sep 23, 2004 1:58 pm
by feyd
create a script that resides on the respective servers and writes the file. (secure it) .. then you can call it from whichever server and write to the file using a form post or some other http transfer method.

Posted: Fri Sep 24, 2004 9:11 am
by d52477001
yeah i thought about that but i wasn't sure exactly how to implement it and how to call the script. Would you mind explaining a bit more?

thanks

Djurre.

Posted: Fri Sep 24, 2004 12:32 pm
by feyd
you can use [php_man]curl[/php_man] or the file url wrapper functions ([php_man]file_get_contents[/php_man], [php_man]fopen[/php_man]) to make a query to the other page.. you could add some checksums or something to help secure the input, so the script knows it's from you.