Php multiple file upload foreach




















Possible duplicate of Multiple file upload in php — Farshid Shekari. U can use foreach instead of for in php section of first answer that has score. I have used foreach only, my question is I am uploading more than two image at a time. Show 2 more comments.

Active Oldest Votes. Try this Improve this answer. Farshid Shekari Farshid Shekari 1, 3 3 gold badges 23 23 silver badges 45 45 bronze badges. Add a comment. I will upload three image at a time and i want to see? Show 8 more comments. Sign up or log in Sign up using Google. Moving on to the PHP codes. To access them we will be using foreach foreach loop.

Now to make the verification part. First we will make an array with the allowed extensions in it. As we are making an image upload , we need to allow only the image extensions i. You can add the appropriate extensions that you need. That is all with upload part, the files are ready to be moved to a folder and store the file details in MySQL table's if necessary. In this tutorial we use a MySQL table with 4 rows. What i include. Also I need the script to get multiple images by javascript and save them by php.

So you would use a foreach statement to assign a variable to this key. I would disagree with this statement as it makes your application very limited to the user, not scalable and in the end more coding required to handle each distinct input name you make.

Say your site deals with real estate, classic cars or any site where the user would upload many images like 20 or more.

Are you going limit the user to only the predefined inputs you have made? I only made the site for three images.



0コメント

  • 1000 / 1000