I am trying to upload a file via HTTP and run it through a virus scan and immediately move to a ftp location. Here are the basic steps,
- Upload via HTTP
- Do the virus scan on the php tmp directory (upload_tmp_dir) using 开发者_Python百科php command line functions.
- Move the file directly to ftp from the tmp directory after the virus check.
You might notice I am not doing a move_upload_file(), is this the best way to do it ? Or should I do steps 2 & 3 after I do a move_upload_file().
If I should not do it before move_upload_file() then what would be the reason ?
Thanks
I think that doing it before move_upload_file
is appropriate. If you move it first, then you've put a file into your FTP directory which may have a virus; for the length of time that you scan, an unsafe file is available.
Also, if you do it before move_upload_file
and find a virus, you can just leave it there and PHP will tidy up for you; no need to call unlink
yourself :)
精彩评论