Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

File upload does not retrieve name of file codeigniter

Featured Replies

Hello all,

 

I'm using CodeIgniter and I'm attempting to upload video files. Here's my snippet of code for the view:

 

 

 
      <input type="file" name="userfile" class="userfile" />
 

 

And here's the snippet of code for the controller:

 

 

 
    $file_name = $_FILES['userfile']['tmp_name'];
 
    if(filesize($file_name) == 0)
     {
        
         exit('File does not exist!');
         return FALSE;
                        
     }
 

 

I have an exact similair piece of code for my upload images file and it works fine, however, my video file upload just does not retrieve the file name or file size. I've googled everywhere but I can't find any answers to this problem. Can anyone help?

 

Thanks in advance.

  • Author

Thanks for replying Nock but I've tried the suggested code but it still doesn't seem to pick up the file at all, (it still goes into the if function), as there's no file. I'll keep trying different methods.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.