[PHP] handling .zip and .sit files
I'm working on an application which allows cartoonists to upload and schedule comic strips at webcomicsnation.com. At present, the way it works is that the cartoonist uploads a strip on one page of a wizard style form, then enters metadata about the strip (date it should go live, description, title, which series it belongs to, etc., etc) on another page of the same wizard. This works for about 90% of our alpha testers. However, many of the cartoonists have digital archives that go back for years, and are looking for a way to mass-upload, say, five hundred strips, and have them entered into the database automatically. Since most of the people with this problem have been using the popular Keenspace.com file-naming convention, the dates these files were originally supposed to go live on the cartoonist's site are easily derived from the filename (e.g. 20030101.gif). For various reasons, I am unable to give FTP access to the cartoonists -- only http upload. What I'd like to find is a pre-written (free or commercial) object that will a). Open an uploaded .zip or .sit archive. b). Allow me to manipulate the files -- move them to each cartoonist's own directory, for example, and rename them to some random value. c). Allow me to enter data records for each file, based on its original filename (I can't collect ALL the metadata that will be needed this way, but the date field is the way that the cartoonist's archives are organized, so I can at least get the strips in the correct order in the public archive) and, of course its new filename. I've found plenty of ways to open and manipulate .tar files, but these cartoonists (generally using Mac's) aren't really going to be comfortable with that. I've also found at least one object that will allow me to open .zip files (I think -- haven't tested it), but, again, some of these guys go all freaky on me when they can't do exactly what they're used to doing. Which is, of course, the perogative of the paying user (grin). They'd rather have .sit. Anybody know of anything like this? If not, is anybody willing to give me a quote for developing something like this for me? Thanks! Joey www.webcomicsnation.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] naming a directory after a user-submitted string
Thanks for the thoughts on .sit files. I still don't quite know what I'll do (maybe I'll just force'em to make .zips -- it's not like it's IMPOSSIBLE for a Mac to make .zips). Here's another question, possibly easier. Possibly even bone-headed. What kind of checking/filtering/changing do I need to do on a user-submitted string before I can feel comfortable using it to name a new directory in the web root on Linux/Apache? Anybody have a quick Regular Expression they can toss at me? If so, I'd be muchly appreciative. Or is this just a Terrible Idea That Should Never Be Contemplated? Thanks! Joey www.moderntales.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] connecting PHP to MS Access
There are far more elegant ways to do it. But for such a small file, the looping-through-and-writing-sql-inserts-one-at-a-time should work just fine. As long as you don't have to do it more than once, and the file is so small, that's what I'd do. I've done it that way before. An even uglier way: create a MS Word mailmerge document, the body of which consists solely of your sql insert query (with the relevant values being pulled from the Access file). Then run the mailmerge. Then copy-paste the resulting document into your MySql admin tool of choice. Ugly, ugly, ugly. But it works. And, embarrassed as I am to admit it, I've done it that way, too. ;) Joey www.moderntales.com - Original Message - From: Tim Thorburn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:24 PM Subject: [PHP] connecting PHP to MS Access Hi, Ok, I know I've already spoken blasphemy ... but hear me out. I have a client who wants to move her real estate site from a local ISP to a somewhat decent service. Currently her site is all in Access/ASP - since I know not of that world, I'm converting it to MySQL/PHP. The person they had before I'm told either took the database file they're currently using from a friends job, or some manual somewhere, so its not setup as well as it could be, so I've re-created the tables in MySQL to function a little better. I've used most of the same names from the Access file, but a few things have had to be changed - its not a huge database, about 200 entries with about 40 rows each, but I'd rather not cut and paste all that in - I've tried exporting to CVS ... but its quite a jumbled mess, so the next best thing I thought would be to write a script to do the work for me. I'm guessing its just a matter of connecting to Access, and going query by query through its database, pulling the fields I want then inserting them into MySQL and looping through the process once again. Now, the question is - how to connect PHP to MS Access? I've done some searching on Google - most pages say wow, good luck with that or something similar - any thoughts? I'm sure someone has had to do this before - am I on the right track or should I be looking elsewhere? Thanks -Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php