can't get upload to work at all

See all posts See thread Reply

Re: can't get upload to work at all new!
by colin, 11 years, 3 months ago
I am not sure what framework you are using.

But you need to instantiate the class with an upload field, that is an value from the array $_FILES. In your code, it seems that your upload file (input type="file") doesn't have a name. It should, and then you use this name to find the correct value in the $_FILES array.

Look at the code sample in the class itself, it is a minimal example showing how to create a form and instantiate the class. In your case, your form fields are incomplete, and cannot work.Reply
Re: can't get upload to work at all new!
by Kathy, 11 years, 3 months ago
Got it. Gave my "input type=file" a name attribute with the value 'attachment', and changed to :
$handle = new Upload($_FILES['attachment']);

Works great now. Thanks so much for the quick responses!Reply