File upload issue [part 2]

I have already discussed about the file upload issue in this post. In this blog post I will give some code for uploading the files into the server.
Easy way to check the file extension in php:

$ext = end(explode(".",strtolower($_FILES['theupload']['name']))); 

In this line of code I get the extension of any uploaded file in our script. after getting the extension you can check whether it is an image or a video. In this portion I will check whether it is an image or not by a normal conditional statement.

if($ext=="jpg" || $ext=="jpeg" || $ext=="gif" || $ext=="png") {
//do stuff
 //give user an error msg.

Problem while uploading long tail video?
It is a problem while uploading long tail video on the server even when you want to upload a video file more than 16 MB without configuring your php.ini file, you will have problems :(, problems that can make you crazy over your php script. Frankly I was that much crazy with my php script. I knew that I do not have problems in my script but while uploading long tail video the whole screen become blank :(. There is one thing you can do in this situation. You can search into google about uploading long tail video and another important thing is checking your php.ini file for the uploading configuration. Here I am listing the settings in php.ini what we need to modify.


Read the documentation there in the file and after changing the settings you need to restart your xampp. You are ready to upload now according to your limit settings 🙂


About Mazharul Anwar

Platforms | Softwares | Softwares Development Processes
This entry was posted in Programming and tagged , , , , , . Bookmark the permalink.

1 Response to File upload issue [part 2]

  1. social media says:

    Great post. I used to be checking constantly this blog and I’m impressed!
    Very helpful information particularly the closing part 🙂 I
    maintain such information much. I was seeking this particular info for a long time.
    Thank you and best of luck.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s