LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   An Unknown Filter Was Not Added:PHP (https://www.linuxquestions.org/questions/linux-software-2/an-unknown-filter-was-not-added-php-495322/)

lovalixir 10-25-2006 12:09 AM

An Unknown Filter Was Not Added:PHP
 
Hi,

I am trying to use Visual C#.NET to Upload pictures to my Linux Server. And Apache kept giving me this error


"An Unknown Filter Was Not Added:PHP"

I think it has something to do with the configuration of Apache.

client.UploadData("http://www.myserver.com/",UploadImage);

And Yup. I have already set the file permission on the server side corretly. Can any one help me with this problem?

Leo

claytonjohnroby 10-25-2006 10:30 PM

From what I read after searching for client.UploadData this function uploads a data buffer to a resource with the specified URI.

This leads me to believe that
Code:

client.UploadData("http://www.myserver.com/",UploadImage);
sends the data contained in the "UploadImage" variable to the "http://www.myserver.com/" URI.

Assuming http://www.myserver.com/ defaults to http://www.myserver.com/index.html this would just send data to a process that serves the index.html file. I think that this would not do much at all.

Something better might be

Code:

client.UploadData("http://www.myserver.com/loadimage.php?imagedata=",UploadImage);
Where loadimage.php can process the data now stored in the imagedata variable.

Another alternative is to replace the PHP script with a CGI script.

The error that you received might indicate that your server is configured to default to index.php instead of index.html is which case you might be sending binary data directly to a PHP script and it is getting confused.

lovalixir 10-29-2006 07:22 PM

Quote:

Originally Posted by claytonjohnroby
From what I read after searching for client.UploadData this function uploads a data buffer to a resource with the specified URI.

This leads me to believe that
Code:

client.UploadData("http://www.myserver.com/",UploadImage);
sends the data contained in the "UploadImage" variable to the "http://www.myserver.com/" URI.

Assuming http://www.myserver.com/ defaults to http://www.myserver.com/index.html this would just send data to a process that serves the index.html file. I think that this would not do much at all.

Something better might be

Code:

client.UploadData("http://www.myserver.com/loadimage.php?imagedata=",UploadImage);
Where loadimage.php can process the data now stored in the imagedata variable.

Another alternative is to replace the PHP script with a CGI script.

The error that you received might indicate that your server is configured to default to index.php instead of index.html is which case you might be sending binary data directly to a PHP script and it is getting confused.

Yes indeed what you said is correct. I need to pass some image data to php file to sort of start process. But if I send the image data to say loadimage.php?imagedata=? would it takes the file data in? Right now I am doing some sort of PUT method on PHP to upload the picture and it works. But I would be glad if I can use POST method. Because that makes the programming much easier.

And again, thanks for your suggestion.

claytonjohnroby 10-29-2006 11:41 PM

From what I have read and understand putting
Code:

http://www.somedomain.com/some-php-script.php?some_php_variable="some data to be placed into some variable for processing"
in the address bar of a browser is the same as
Code:

some_variable="some data to be placed into some variable for processing";
WebClient.UploadData("http://www.somedomain.com/some-php-script.php?some_php_variable=",some_variable");

inside a c# script.

If you look on msdn and search for this function you will see that you can specify the method used to send the data. POST is one of the methods available.

lovalixir 10-30-2006 12:49 AM

Quote:

Originally Posted by claytonjohnroby
From what I have read and understand putting
Code:

http://www.somedomain.com/some-php-script.php?some_php_variable="some data to be placed into some variable for processing"
in the address bar of a browser is the same as
Code:

some_variable="some data to be placed into some variable for processing";
WebClient.UploadData("http://www.somedomain.com/some-php-script.php?some_php_variable=",some_variable");

inside a c# script.

If you look on msdn and search for this function you will see that you can specify the method used to send the data. POST is one of the methods available.

Thanks alot. That's really help me. =)


All times are GMT -5. The time now is 05:27 PM.