views:

64

answers:

1

I am trying to upload multiple files but when i select more than 1 djz_file it doesn't get any information form $_POST and $_FILES, in case of single file it works well.

<fieldset>
                    <legend>Add New Release</legend>
                    {if $action eq 'failure'}
                            <div class="error">Release Add, {$action}</div>
                    {/if}
                    <form class="niceform" method="post" action="xxxxxx.php" enctype="multipart/form-data" name="frmMovie" id="frmMovie">
                            <input type="hidden" name="MAX_FILE_SIZE" value="9000000" />
                            <dl>
                                    <dt><label for="release">Movie Name:</label></dt>
                                    <dd><input type="text" name="djz_release" id="djz_release" size="32" maxlength="128" /></dd>
                                    <dd><input type="file" name="djz_image" id="djz_image" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="gender">Movie Rating:</label></dt>
                                    <dd>
                                            <select size="1" name="djz_rate" id="djz_rate">
                                                    <option value="1">1 </option>
                                                    <option value="2">2 </option>
                                                    <option value="3">3 </option>
                                                    <option value="4">4 </option>
                                                    <option value="5">5 </option>                   
                                            </select>
                                    </dd>
                            </dl>

                            <dl>
                                    <dt><label for="date">Release Date:</label></dt>
                                    <dd>
                                            <input type="text" readonly="readonly" name="djz_date" id="djz_date" />
                                    </dd>
                            </dl>

                            <dl>
                                    <dt><label for="release">Song(s) Name:</label></dt>
                                    <dd><input type="text" name="djz_song_name" id="djz_song_name" size="32" maxlength="128" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 1:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 2:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 3:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 4:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 5:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 6:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 7:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 8:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 9:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt><label for="song1">Song 10:</label></dt>
                                    <dd><input type="text" name="djz_song[]" /></dd><dd><input type="file" name="djz_file[]" /></dd>
                            </dl>

                            <dl>
                                    <dt></dt>
                                    <dd><input type="submit" value="Save Release" /></dd>
                            </dl>
                            <input type="hidden" name="sub_act" value="add" />
                    </form>
            </fieldset>
+1  A: 

Uploading audio files for those slots, you are certainly exceeding some, and probably all, of the various limits on the maximum size of upload you can perform. In your HTML itself, you have

<input type="hidden" name="MAX_FILE_SIZE" value="9000000" />

which isn't going to accomodate multiple audio files. There will also be your PHP config's upload_max_filesize and post_max_size to contend with (in php.ini or the other various places these can be modified).

If you write your PHP form processor so that it checks for and provides feedback on the $_FILES['foo']['error'] field, it will help a lot in debugging file uploads.

chaos
OK Thanks for the prompt reply i am gona try to fix this n will report you after trying this. any ways thanks again.
Thanks chaos, it works really, you solved my problem. Thank you very much, you are the life saviour ;)