Uploading An Image To A MySQL Database Using A Blob

后端 未结 1 455
野的像风
野的像风 2020-12-22 00:23

Just to first clarify, I know there are better ways to do this, but I\'m determined to experiment.

Basically, I\'m trying to grab an image from a form post, then se

相关标签:
1条回答
  • 2020-12-22 01:08

    You write:

    $_imagePost = file_get_contents($_FILES['_imagePost']);
    

    The correct syntax is:

    $_imagePost = file_get_contents($_FILES['_imagePost']['tmp_name']);
    

    $_FILES is an associative array whit following keys:

    • [name] => Original file name;
    • [type] => mimetype of uploaded file;
    • [tmp_name] => temporary filepath (where uploaded file is stored);
    • [error] => error;
    • [size] => size of uploaded file.

    • See more about $_FILES
    0 讨论(0)
提交回复
热议问题