Ok, i understand.
It is better not to trust user's input for file name. Any user can rename php file into .doc file and this is not right. In order to append file extension in your new file name...
1st :
If user's browser provided the file type information, you can access it in $_FILES['type'] (in your example is : $_FILES['file']['type'])when proccessing upload. Or use fileinfo extension. But...
I have a file (for example : play.php). That file has a duty to control an application (OpenOffice Impress->SlideShow). Control means to open(run slideshow) and close the application. When i try to...
I was wrong.
Do not use \W in my first example, because it will match also with : #~!@#$%^&*() and other else(which belong to your message), not only the vertical whitespace.
First : why do you use psexec command to use tool in your own machine? Have try it without psexec?
Second : if you insist use it, have you check the permission? xp or vista permission..
Third :...
Try to use \v for vertical whitespace character (since PHP 5.2.4).
Or using pattern : read[nonwordcharacter]yourmessage.
Non word character is : \W or you can customize it.
Try take a look at :
escapeshellarg() and escapeshellcmd().
If still no luck, try to put the command inside autoexec file. (.bat or other) than execute the file.