Re: [PHP] Re: file upload question
i add me to the question. 2009/8/3 Peter Ford > seb wrote: > > Hey all, > > > > i am using move_upload function to upload files to the server, but i > > want to add a feature that will allow files to be archived that have > > been uploaded already. > > > > so, the problem is: > > > > i upload a file that i want to "upgrade" and move the old file to an > > archive directory but I want to verify the NEW file is upload BEFORE > > moving the old file (the file being uploaded might not have the same > > filename as the old file currently on the server).. > > > > i want to move the old file only when the new file was successfully > > uploaded. something like: > > > > if(move_uploaded_file()) > > { > >rename(...); > > } > > > > only one problem.. then if both files have the same name it will be > > overwritten before it moves the old one i want to save. if i move the > > old one first, there still the possibility of the new upload failing so > > i am back to square one.. > > > > i guess i can move_upload to a different directory, verify it's been > > uploaded, move the old to the archive file, then move the new file back > > to where it should be (where the archive file was).. > > > > is that my only option? any suggestions? > > I'd suggest you *copy* the old file (if it exists) to archive anyway, and > then > *move* it back if the new version doesn't verify. That seems pretty safe to > me... > > -- > Peter Ford phone: 01580 89 > Developer fax: 01580 893399 > Justcroft International Ltd., Staplehurst, Kent > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] php external interfaces
well i know the command shell_exec(), that work like console, just put de command as paramether. More info in php documentation. For COM objects for example, $word = new COM("word.application") or die("Unable to instantiate application object"); $wordDocument = new COM("word.document") or die("Unable to instantiate document object"); $word->Visible = 0; $wordDocument = $word->Documents->Open($DocumentPath); $HTMLPath = substr_replace($DocumentPath, 'txt', -3, 3); $wordDocument->SaveAs($HTMLPath, 3); $wordDocument = null; $word->Quit(); $word = null; this opens a word document and save it as .txt document. there should be more info in the MSDN documentation. 2009/8/8 Robert Cummings > pete123456 wrote: > >> hi, >> im running php on IIS and im trying to evaluate php's capabilities >> regarding >> external interfaces. >> elg. executing .exe, batch files, com objects. is that all possible? does >> anyone have any good reference where i can find out more about this? >> > > .exe and .bat files should work fine, the do for me. Have you tried? I > haven't really done anything with com objects. > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] Web Service Server in PHP
Hi, Does anybody knows a web services server based on PHP? The only one a see is Nusoap, but even for this one i can't find the webpage to see the documentation. by the way, i'm trying to develop an application using web services in PHP, any start point suggestion will be appreciated. thanks for the anwers!