Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write code for uploading PHP swfupload pictures

Shulou Source: shulou.com Published: 2022-06-03 07:37:56 09月17日 Update

This article mainly introduces "how to write the code for uploading PHP swfupload pictures". In the daily operation, I believe many people have doubts about how to write the code for uploading PHP swfupload pictures. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to write the code for uploading PHP swfupload pictures". Next, please follow the editor to study!

The PHP code is as follows:

The copy code is as follows:

If (isset ($_ FILES ["Filedata"]) | |! is_uploaded_file ($_ FILES ["Filedata"] ["tmp_name"]) | | $_ FILES ["Filedata"] ["error"]! = 0) {

$upload_file = $_ FILES ['Filedata']

$file_info = pathinfo ($upload_file ['name'])

$file_type = $file_info ['extension']

$save = 'image/'. Md5 (uniqid ($_ FILES ["Filedata"] ['name'])). '.'. $file_info ['extension']

$name = $_ FILES ['Filedata'] [' tmp_name']

If (! move_uploaded_file ($name, $save)) {

Exit

}

/ / Save the output of the array for viewing

$fileName = 'test.txt'

$postData = var_export ($file_info, true)

File = fopen ('. $fileName, "w")

Fwrite ($file,$postData)

Fclose ($file)

}

At this point, the study on "how to write the code for uploading PHP swfupload pictures" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Code pictures learning more help practical next arrays articles methods theories knowledge articles websites materials follow questions easy to use practice solutions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info vpn Shulou Technology Linux