By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,558 Members | 2,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,558 IT Pros & Developers. It's quick & easy.

Auto submitting a form that contains a file field

P: n/a
Hi,

I'm using php 5. Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?

Thanks, - Dave
Mar 31 '08 #1
Share this Question
Share on Google+
10 Replies


P: n/a
la***********@zipmail.com wrote:
Hi,

I'm using php 5. Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?

Thanks, - Dave
Nope. Can't do it with PHP. PHP is server side, and you need client side.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Apr 1 '08 #2

P: n/a
On Mar 31, 10:15*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
Hi,
I'm using php 5. *Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?
Thanks, - Dave

Nope. *Can't do it with PHP. *PHP is server side, and you need client side.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?

- Dave
Apr 1 '08 #3

P: n/a
Hey Dave,

Do you really need it to be input=file? can't you just load the file,
base64_encode it and send it through an input=text?

Or another method would be making the script with the form in one file
and then using CURL to post that script and posting the file through
CURL. Should work.
On Apr 1, 7:05 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
Hi,
I'm using php 5. Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?
Thanks, - Dave
Nope. Can't do it with PHP. PHP is server side, and you need client side.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?

- Dave
Apr 1 '08 #4

P: n/a
la***********@zipmail.com wrote:
On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>laredotorn...@zipmail.com wrote:
>>Hi,
I'm using php 5. Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?
Thanks, - Dave
Nope. Can't do it with PHP. PHP is server side, and you need client side.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?

- Dave
No, the POST is from the client end. The result of the POST is server end.

Client end is NOT php. Neither is the enctype nor the <input type=file tag.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Apr 1 '08 #5

P: n/a
On Apr 1, 2:05 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
Hi,
I'm using php 5. Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?
Thanks, - Dave
Nope. Can't do it with PHP. PHP is server side, and you need client side.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?
- Dave

No, the POST is from the client end. The result of the POST is server end.

Client end is NOT php. Neither is the enctype nor the <input type=file tag.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
From what he's saying I'd think he tries to make an auto-poster to do
posts in another website's form or a form located in another script,
and that si doable using PHP.
Apr 1 '08 #6

P: n/a
George Maicovschi wrote:
On Apr 1, 2:05 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>laredotorn...@zipmail.com wrote:
>>On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
Hi,
I'm using php 5. Does anyone have any code or a function that auto
submits a form that contains a single INPUT, of type = file?
Thanks, - Dave
Nope. Can't do it with PHP. PHP is server side, and you need client side.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?
- Dave
No, the POST is from the client end. The result of the POST is server end.

Client end is NOT php. Neither is the enctype nor the <input type=file tag.

From what he's saying I'd think he tries to make an auto-poster to do
posts in another website's form or a form located in another script,
and that si doable using PHP.
No, I read it as he's trying to automatically submit a form from the
browser. But it really isn't clear.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Apr 1 '08 #7

P: n/a
On Apr 1, 6:49*am, George Maicovschi <georgemaicovs...@gmail.com>
wrote:
On Apr 1, 2:05 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:


laredotorn...@zipmail.com wrote:
On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>laredotorn...@zipmail.com wrote:
>>Hi,
>>I'm using php 5. *Does anyone have any code or a function that auto
>>submits a form that contains a single INPUT, of type = file?
>>Thanks, - Dave
>Nope. *Can't do it with PHP. *PHP is server side, and you need client side.
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@attglobal.net
>==================
Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". *I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?
*- Dave
No, the POST is from the client end. *The result of the POST is serverend.
Client end is NOT php. *Neither is the enctype nor the <input type=file tag.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

From what he's saying I'd think he tries to make an auto-poster to do
posts in another website's form or a form located in another script,
and that si doable using PHP.- Hide quoted text -

- Show quoted text -
Hi, George interpreted my question correctly. George (and anyone
else), regarding your question
Do you really need it to be input=file? can't you just load the file, base64_encode it
I guess it doesn't have to be input=file. But when you say "load the
file", what do you mean? Thanks, - Dave
Apr 1 '08 #8

P: n/a
On Apr 1, 10:15 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
On Apr 1, 6:49 am, George Maicovschi <georgemaicovs...@gmail.com>
wrote:
On Apr 1, 2:05 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
>Hi,
>I'm using php 5. Does anyone have any code or a function that auto
>submits a form that contains a single INPUT, of type = file?
>Thanks, - Dave
Nope. Can't do it with PHP. PHP is server side, and you need client side.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ...
or can you?
- Dave
No, the POST is from the client end. The result of the POST is server end.
Client end is NOT php. Neither is the enctype nor the <input type=file tag.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
From what he's saying I'd think he tries to make an auto-poster to do
posts in another website's form or a form located in another script,
and that si doable using PHP.- Hide quoted text -
- Show quoted text -

Hi, George interpreted my question correctly. George (and anyone
else), regarding your question
Do you really need it to be input=file? can't you just load the file, base64_encode it

I guess it doesn't have to be input=file. But when you say "load the
file", what do you mean? Thanks, - Dave
A link to the script your are trying to post in would be of much help,
but as I see, you should use either CURL or WGET to post it and use --
post-file in wget or the equivalent in CURL to do the thing.

Hope it helps.

George
Apr 1 '08 #9

P: n/a
On Apr 1, 2:54*pm, George Maicovschi <georgemaicovs...@gmail.com>
wrote:
On Apr 1, 10:15 pm, "laredotorn...@zipmail.com"

<laredotorn...@zipmail.comwrote:
On Apr 1, 6:49 am, George Maicovschi <georgemaicovs...@gmail.com>
wrote:
On Apr 1, 2:05 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>laredotorn...@zipmail.com wrote:
>>Hi,
>>I'm using php 5. *Does anyone have any code or a function thatauto
>>submits a form that contains a single INPUT, of type = file?
>>Thanks, - Dave
>Nope. *Can't do it with PHP. *PHP is server side, and you need client side.
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@attglobal.net
>==================
Actually this would be a server side function that POSTs to a URL and
the enctype would be "multipart/form-data". *I've found tons of stuff
that auto-submit forms where you can put the parameters in a query
string, but with inputs that are of file types, you can't do that ....
or can you?
*- Dave
No, the POST is from the client end. *The result of the POST is server end.
Client end is NOT php. *Neither is the enctype nor the <input type=file tag.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
From what he's saying I'd think he tries to make an auto-poster to do
posts in another website's form or a form located in another script,
and that si doable using PHP.- Hide quoted text -
- Show quoted text -
Hi, George interpreted my question correctly. *George (and anyone
else), regarding your question
Do you really need it to be input=file? can't you just load the file, base64_encode it
I guess it doesn't have to be input=file. *But when you say "load the
file", what do you mean? *Thanks, - Dave

A link to the script your are trying to post in would be of much help,
but as I see, you should use either CURL or WGET to post it and use --
post-file in wget or the equivalent in CURL to do the thing.

Hope it helps.

George- Hide quoted text -

- Show quoted text -
Thanks. As I write the script, I will post more. On the server end,
how do I retrieve the file? For example, in the wget command, I can't
see how you specify the file's parameter name. - Dave
Apr 1 '08 #10

P: n/a
la***********@zipmail.com wrote:
On Apr 1, 2:54 pm, George Maicovschi <georgemaicovs...@gmail.com>
wrote:
>On Apr 1, 10:15 pm, "laredotorn...@zipmail.com"

<laredotorn...@zipmail.comwrote:
>>On Apr 1, 6:49 am, George Maicovschi <georgemaicovs...@gmail.com>
wrote:
On Apr 1, 2:05 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
laredotorn...@zipmail.com wrote:
>On Mar 31, 10:15 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>laredotorn...@zipmail.com wrote:
>>>Hi,
>>>I'm using php 5. Does anyone have any code or a function that auto
>>>submits a form that contains a single INPUT, of type = file?
>>>Thanks, - Dave
>>Nope. Can't do it with PHP. PHP is server side, and you need client side.
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>jstuck...@attglobal.net
>>==================
>Actually this would be a server side function that POSTs to a URL and
>the enctype would be "multipart/form-data". I've found tons of stuff
>that auto-submit forms where you can put the parameters in a query
>string, but with inputs that are of file types, you can't do that ...
>or can you?
> - Dave
No, the POST is from the client end. The result of the POST is server end.
Client end is NOT php. Neither is the enctype nor the <input type=file tag.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
From what he's saying I'd think he tries to make an auto-poster to do
posts in another website's form or a form located in another script,
and that si doable using PHP.- Hide quoted text -
- Show quoted text -
Hi, George interpreted my question correctly. George (and anyone
else), regarding your question
Do you really need it to be input=file? can't you just load the file, base64_encode it
I guess it doesn't have to be input=file. But when you say "load the
file", what do you mean? Thanks, - Dave
A link to the script your are trying to post in would be of much help,
but as I see, you should use either CURL or WGET to post it and use --
post-file in wget or the equivalent in CURL to do the thing.

Hope it helps.

George- Hide quoted text -

- Show quoted text -

Thanks. As I write the script, I will post more. On the server end,
how do I retrieve the file? For example, in the wget command, I can't
see how you specify the file's parameter name. - Dave
Don't even try to use wget. Rather, use http and submit the file from
your server to the other server.

Google on File upload cURL.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Apr 2 '08 #11

This discussion thread is closed

Replies have been disabled for this discussion.