sonnyb Posted April 22, 2009 Share Posted April 22, 2009 Is it possible to use PHP to set a file downloaded (from a Linux server) to have a 'hidden' attribute on Windows systems? We have an internal app at our company for putting together presentations (they download as a zip), but it requires asset folders & autorun files, and it would be nice if we could have these set to hide by default when they are downloaded. My only thinking was that it may be possible using exec() in some way? Thanks! Link to comment https://forums.phpfreaks.com/topic/155158-setting-file-attributes-to-hidden/ Share on other sites More sharing options...
Axeia Posted April 22, 2009 Share Posted April 22, 2009 Going by http://www.astahost.com/info.php/how-hide-files-xp_t2872.html I'd say exec( "attrib +h ".$pathToFile ); Link to comment https://forums.phpfreaks.com/topic/155158-setting-file-attributes-to-hidden/#findComment-816200 Share on other sites More sharing options...
sonnyb Posted April 22, 2009 Author Share Posted April 22, 2009 Thanks, I tried that but it didn't work, sadly. Not getting any errors (except when the $pathtofile is not in quotes, in which case I get "divide by zero" warnings), but they are still visible when it has downloaded. Link to comment https://forums.phpfreaks.com/topic/155158-setting-file-attributes-to-hidden/#findComment-816219 Share on other sites More sharing options...
tang Posted April 22, 2009 Share Posted April 22, 2009 http://uk3.php.net/function.exec exec( "attrib +h ".$pathToFile, $output ); var_dump($output); Link to comment https://forums.phpfreaks.com/topic/155158-setting-file-attributes-to-hidden/#findComment-816230 Share on other sites More sharing options...
Axeia Posted April 22, 2009 Share Posted April 22, 2009 How the hell did you end up with division by zero with strings? And what the poster above did, that should show you any errors in case something goes wrong with the command itself. Link to comment https://forums.phpfreaks.com/topic/155158-setting-file-attributes-to-hidden/#findComment-816271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.