Jump to content

JustFoo

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by JustFoo

  1. im running windows 2k3 server with iis 6 and i setup php manually following the steps using the isapi dll and for some reaosn when ever i try running a php script a login is required and once i login the script runs and everything is fine...i know permissions r screwed up somewhere but im just not sure what im doing wrong. Any ideas? thanks justfoo
  2. I gave popen a try and still no dice any other ideas it seems the exe is not running or im just not getting back the output but im guessing more towards the exe not running at all.
  3. Hello, Im trying to run a program from php using exec function but the only thing im getting returned is Array() and -1 The program just checks the file type of the file and prints out in the command line what it is and i need that information [code] $test = exec("start /B c:\Program"." Files\GnuWin32\bin\file.exe C:\PHP\php.exe", $output, $return); print_r($output); echo "<br />".$return."<br />"; echo $test."<br />"; [/code] thanks for any help
  4. Well shogun i gave the code you suggested a shot and it seems to be working okay thanks all JustFoo
  5. yea i wish it were that easy i have tried all those solutions and everytime something new causes a problem... firstly i have a block on the extenstion but if someone decides to do example.exe and make it example.exe.gif or example.gif then the file gets through so thats just a prelimary block... i also have tried the global $_FILES['foo']['type'] however an interesting problem arose with that...my actual upload begins from a flash form and then flash passes the file off to my php script so no matter what file i send they all have the exact same mime type application/octet-stream...so that idea was a wash then i tried installing an extension on the server and for somereason it works twice and then just stops working and the only way to get it working again is to restart the server which is unacceptable.... so now im left with doing this on my own by matching specific patterns within the files...so far i have a function which works pretty well matching the first 4 bytes and it finds exes, dlls, and such but for plain txt files i need to read the whole file to match patters like #!/bin/foo or <?php or @echo off...just common script type indicators.... garrrrrrr thanks again
  6. yea i had found some things about that but wasnt too sure.. another quick question about the upload script i am attempting to block files like html, or shell script files or batch files...my only thought about doing that would be to scan the file for certain key strings and if they match then thats the type of file...is there any other way to go about this also im having trouble scanning in the file line by line so i can test one line at a time instead of the entire file as one big string.  Right now i have the file as one big string but im not sure how i would test a specific string across the whole file would i haeto break the file up into specific sized chunks first??? thanks again
  7. Hello all, I have an upload script which uploads files to my server(windows) and what i would like to do is once the file is put into a safe directory just scan it with a virus scanner then if its clean move it to the correct directory on the server.  Is there any virus scanners that can be called with php?  My only thought was to just setup a scan everytime a new file was added to that specific folder. thanks
  8. i restarted the web server and again the function worked fine then all of a sudden just stopped working again...is there any other way to figure out the type of a file not based on the file extension alone???
  9. i redownloaded php and took the mime file from that and it still didn't work.  Any other ideas???? thanks for the help
  10. anyway i can get a new mime.magic file or something??
  11. now it says on my phpinfo page  mime_magic support invalid magic file, disabled Directive Local Value Master Value mime_magic.debug On On mime_magic.magicfile c:\PHP\extras\magic.mime c:\PHP\extras\magic.mime
  12. why would it say its not initialized??
  13. magic.mime [attachment deleted by admin]
  14. same exact error idk why but a little while ago it worked fine the way i had the script it returned image/gif and then i tried a different file and it returned that mime type then when i tried a third file it just stopped printing out the type and then i did a is_function(mime_content_type) and it told me that its not a function and now im here...
  15. Warning: mime_content_type() [http://www.php.net/mime_magic]: mime_magic not initialized in C:\path to script\test.php on line 6 line 6 is echo  mime_content_type($file); mime_magic shows up if i do like phpinfo();
  16. Hello all, I am attempting to use the mime_content_type('filename') function that comes in the mime_magic dll, I followed all instructions to set it up and edited the php.ini file and restarted the server and this morning it worked 2 times then just stopped working for some reason.  The script i had running doesnt show the mimetype of files anymore.  Script: $file = "\\pathToFile\\php.gif"; echo mime_content_type($file); php.ini: extension=php_mime_magic.dll [mime_magic] mime_magic.debug = on mime_magic.magicfile = "c:\PHP\extras\magic.mime" thanks for any help JustFoo
  17. Hello all, I have created a file upload script in php and it works fine however i was wondering is there a way to restrict what files i allow people to upload not based on the extension because right now i only allow .txt and .jpeg files but if i have a .exe file and i just add or change the extension to .txt i can still upload the file. is there a way to do another type of check on the file to figure if its an .exe or .dll or some other type of file besides the extension? thanks in advance JustFoo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.