Welcome! Log In Create A New Profile

Advanced

Re: upload module forbidden

Francis Daly
April 06, 2011 08:18AM
On Wed, Apr 06, 2011 at 12:09:22AM -0400, vetri wrote:

Hi there,

> what did u do to upload files ? can u give me your code ?and

It is absolutely normal cgi-type programming. There's probably a forum
for that somewhere else.

For example, the following php script called my-form-handler:

===
<?php
header("Content-Type: text/plain");
print("GET: "); print_r($_GET);
print("POST: "); print_r($_POST);
print("FILES: "); print_r($_FILES);
?>
===

with the following nginx config snippet:

===
include fastcgi.conf;
location = /my-form-handler {
fastcgi_pass unix:php.sock;
}
===

will show you what you get when you GET or POST to /my-form-handler.

You can then adjust that script to do whatever you want it to do with
your own input.

> how to use stock nginx can we really upload files using stock nginx?

Yes: you use stock nginx plus your own form handler; or nginx plus upload
module plus your own form handler.

But you still have to have your own form handler.

If you use upload module, then you can use

upload_pass /my-form-handler;

among the rest of the upload module config.

Test with something like

curl -i -F f=@testfile -F submit=on http://localhost/my-form-handler

or

curl -i -F f=@testfile -F submit=on http://localhost/upload

As it happens, the php engine does some of what the upload module does,
as regards processing the input stream and splitting it into files. So
you may see a bigger benefit to using upload module if you use a different
backend technology.

But it looks like the nginx side of the problem is resolved, unless you
have a specific follow-up question.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

upload module forbidden

vetri April 05, 2011 02:17AM

Re: upload module forbidden

Francis Daly April 05, 2011 05:02AM

Re: upload module forbidden

vetri April 05, 2011 05:08AM

Re: upload module forbidden

Francis Daly April 05, 2011 05:42AM

Re: upload module forbidden

Alexander Kunz April 05, 2011 05:48AM

Re: upload module forbidden

vetri April 05, 2011 06:47AM

Re: upload module forbidden

Francis Daly April 05, 2011 06:56AM

Re: upload module forbidden

Alexander Kunz April 05, 2011 07:52AM

Re: upload module forbidden

vetri April 05, 2011 09:43AM

Re: upload module forbidden

Alexander Kunz April 05, 2011 10:02AM

Re: upload module forbidden

Francis Daly April 05, 2011 01:34PM

Re: upload module forbidden

vetri April 06, 2011 12:09AM

Re: upload module forbidden

Francis Daly April 06, 2011 08:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready