How to use value? of input type= "file"

<input type="file" />

I give users several ways to upload messages like
one is to press the input option
, the second is that I have caught the image address of the facebook, and I"m going to put this on the file.
when the user presses submit, it will be uploaded to my server, and do other image processing
, so this action is necessary. Otherwise, I can only deal with the image
, but I find that if I add value, he still doesn"t have an image selected
, so when I press submit, there is no image that can be uploaded

.
$_FILES["myFile_cover"]["name"]

can"t get a name
how do you realize that even if you only have a web address, you can still choose the effect of local press upload?

Mar.17,2021

Why don't you put the captured avatar in a hidden domain and put the file in file?


refer to frontend picture direct transmission OSS experiment the first three part, do not have a name because when you build a FormData instance, you call the append method without the third parameter (file name). Or when writing PHP, if there is no file name, then temporarily generate one (for example, you can use time + N-bit random number), this method is also more common.

  • How to change a tag to button tag?

    because I am connected to facebook, I will need the following functions: $loginUrl = $helper->getLoginUrl( https: xxx.xxx.com fb-sdk fb-callback.php , $permissions); echo <a class="user_signup_btn_facebook" href=" ....

    Mar.14,2021
  • How do you do this sub-division?

    this is my favorite: $page = $_GET[ page ]; $page == ? $page = 1 : ; $page_size = $page_data[ data_1 ]; $res = $pdo->query("SELECT * FROM `blog` "); $row_count = $res->num_rows; $page_num = ceil($row_co...

    Dec.06,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf4b07-30c62.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf4b07-30c62.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?