开发者

can $_FILES superglobal be accessible in class

开发者 https://www.devze.com 2022-12-09 07:44 出处:网络
Does anyone have experience wi开发者_StackOverflow社区th this I wanted to use $_files in my class

Does anyone have experience wi开发者_StackOverflow社区th this

I wanted to use $_files in my class

like

$Uploadfile= $_FILES['file'];

but then the script errors

I thought superglobals were acccessible anywhere

thanks, Richard


Yes, $_FILES is a superglobal, which means that it's accessible from every scope. It's only set if the request actually contains a multipart/form-data body.

0

精彩评论

暂无评论...
验证码 换一张
取 消