Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:19:05+00:00 2026-06-06T07:19:05+00:00

I made an upload system where the user uploads a file and that file

  • 0

I made an upload system where the user uploads a file and that file is saved and then read by php. The values are inserted into a database. The whole thing works great on the development server but not on the live server.

I have another upload system on the live site that works fine. I tried uploading it to a different folder but that didnt work either.

Just so you know the other day i had problems with the mime type. So for example i uploaded a csv file but the server read it as a text/plain document. I configured configured codeigniter to allow that for csv’s so that shouldnt be the problem. Just thought it was worth mentioning.

ERROR:

A PHP Error was encountered

Severity: Warning

Message: fopen(http://144.119.190.87/designUploads/testing.csv): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized

Filename: controllers/headquarters.php

Line Number: 682

==================================================
PHP:

 public function importDesign () {
    //  setting config options
    $config['upload_path'] = './designUploads/';        
    $config['allowed_types'] = 'csv';       
    $config['overwrite'] = 'true';      

    //  loading upload library
    $this->load->library('upload', $config);

    //  write errors to view file
    $error = '';
    if (!$this->upload->do_upload('userfile')) {
        $this->upload->delete($lastId);
    } else {
        $data = array('upload_data' => $this->upload->data());      
    }

    $fileData = $this->upload->data();
    $name = $fileData['file_name'];

    Line 680 ---> if (($handle = fopen(base_url('designUploads/'. $name), "r")) !== FALSE) {
        while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
            $query = $this->db->query('
                UPDATE rollout_systems 
                SET Mig_type = "'. $data[2] .'",
                    hardw_destination = "'. $data[3] .'",
                    new_model = "'. $data[4] .'",
                    new_system = "'. $data[5] .'",
                    Mig_Class = "'. $data[6] .'"
                WHERE sys_name = "'. $data[0] .'"
                AND EAM_User = "'. $data[1] .'"
            ');

            if ($query) {
                redirect('headquarters/migrationDetails');
            }
        }
        fclose($handle);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:19:07+00:00Added an answer on June 6, 2026 at 7:19 am

    Thanks to you two that tried to help. Found the problem while comparing both the uploads i have code. As it turns out fopen() does not support base_url(). Once i got rid of that it worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP image upload system which allows a user to upload various
I have made a html file, but when I upload and test it, I
I made an application that passes trough an XML file and extracts the entries
I have made the following script to upload a csv and import it into
I finally made it to upload a file using core java. Here is my
I'm trying to create a script that will upload a file to a website.
I'm trying to do the following: User goes to web page, uploads XLS file
We know that, JQuery ( or javascript ) can not access local file system.
I am having an upload image system. You upload a image, then you crop
i have made a function to add new upload and description inputs onClick. How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.