Welcome Guest, Not a member yet? Register   Sign In
file upload fails but POST data looks fine (SOLVED - bug?)
#2

[eluser]munkeh[/eluser]
Solved the problem but possibly found a bug/feature? Or maybe I was just doing things wrong all along.

I have been creating forms like this throughout my applications:
Code:
<?php echo form_open('add_claim/upload_file', 'name="upload_form"'); ?>
This results in the following HTML (http:// removed to get around the spam filter):
Code:
<form action="website/add_claim/upload_file" name="upload_form" method="post">

According to the docs I'm supposed to be passing the attributes as an array but juat adding them to the form_open function seemed to be working just fine so I kept on doing it. Truth be told I only really glanced at the docs for the form helper, so my bad there.

Anyway, turns out if you do the same thing with a multipart form it doesn't work:
Code:
<?php echo form_open_multipart('add_claim/upload_file', 'name="upload_form"');?>
gives the following HTML:
Code:
<form action="website/add_claim/upload_file" mame="upload_form" method="post">

note: mame="upload_form" instead of name="upload_form". This, I guess, was causing the do_upload() function to fail.

Anyway, figured I'd at least update the thread in case anyone else was stumped by the same thing.


Messages In This Thread
file upload fails but POST data looks fine (SOLVED - bug?) - by El Forum - 12-08-2010, 09:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB