Thanks alot Richard. As you mention it I've had some encounters with the _ filenames... I did get it to work after a fasion, but yes I took quite some headache to make it work. For the JS part of the script I could just getElementById witch leave me open for the name to use on my problems as you suggest. On Monday 30 October 2006 22:49, Richard Lynch wrote: > On Mon, October 30, 2006 5:13 am, Børge Holen wrote: > > * First it insert an empty file field (hidden). > > This seems silly, but whatever. Yes, I didn't make the JS and don't know why it is so. > > > * Second, I rename all files to an md5 hash. > > * Third, The md5 hash makes legal filenames witch enables my toolset > > to modify > > modify/validate my jpg. > > And MD5 hash seems kind of excessive, when you could do: > $filename = preg_replace('/[^a-z0-9_\\.]i/', '', $filename); > > But whatever makes you happy. md5 seems clean. Does the work witchever character is used. But probably a great deal slower? > > > The problem I seem to be getting at is this; How do I remove, lets > > say, file > > nr 3 of 6. The input fields can easily (because fields is removed and > > added > > dynamicly) be named everything from 'file_1' to 'file_20'. I only want > > Aha! > > Try using name="file[1]" instead of "file_1" and your life will become > MUCH simpler. You can keep your id="file_1" for JS to use > getElementById and muck with what's visible, but your PHP will be > soooo much easier with name="file[1]" > > > jpg's > > , so that gif in nr 3 has to be removed before the md5 hash rename. > > > > I could use splice_array to get at it just as I do with the first > > empty one, > > but then again, how do I count down the fields to get to the non valid > > file > > types. > > Once you use name="file[3]" there is no count down. > It's an array. -- --- Børge Kennel Arivene http://www.arivene.net --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php