derrickrozay's avatar

Angular2 Error trying to upload image to Lumen backend

I am trying to upload an image to my database as a blob (I know its bad practice but I have to). The error I keep getting is Call to a member function openFile() on null

My form

<form ngNoForm action="http://Api.app/api/v1/uploadImage" target="_blank" method="POST">
  <input type="file" name="image" id="image">
  <input type="submit" value="Upload Image" name="submit">
</form>

EDIT:

The problem was that I was missing enctype="multipart/form-data" in my form

0 likes
1 reply
derrickrozay's avatar
derrickrozay
OP
Best Answer
Level 1

Problem solved I was missing enctype="multipart/form-data"

Please or to participate in this conversation.