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

  • Home
  • SEARCH
  • 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 7616521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:54:30+00:00 2026-05-31T02:54:30+00:00

I am trying to upload my php project into public server. I made the

  • 0

I am trying to upload my php project into public server.
I made the image upload file when I create product or edit product.
It works in localhost, but when I move to public server, it is not working.
I think move_uploaded_file part does not working.
How can I change the link? or do I have to change anything?
When I see Filzilla, I can see remote site that it is ‘/www/eshopProject/inventory_images’.
And index file is ‘/www/eshopProject/storeAdmin’.
Do I have to change link like this?
I don’t know how can I change the link.
Could you help me? uploading the image into public server is not working..
Is it any security issue? or something?
Please help me. Thanks.

–index.php–

$pid = mysql_insert_id();
//Place image in the folder
$newname = "$pid.jpg";
move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/product_$newname");
  • 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-05-31T02:54:31+00:00Added an answer on May 31, 2026 at 2:54 am

    First of all check the permissions of the directory as mentioned in come of the comments.
    If you have shell access “chmod 777 target_dir” or “chmod 707 target_dir” should be sufficient.

    Second try to debug it using if’s and the file_exists function(http://php.net/manual/en/function.file-exists.php).

    Something like this.

    $uploadedFile = $_FILES['fileField']['tmp_name'];
    $destination = "../inventory_images/product_$newname";
    
    if(file_exists($uploadedFile))
    {
       echo "file uploaded to temp dir";
    }
    else
    {
       echo "file upload failed";
       exit();
    }
    
    if(move_uploaded_file($uploadedFile, $destination))
    {
       echo "upload complete";
    }
    else
    {
       echo "move_uploaded_file failed";
       exit();
    }
    

    You can also check your current working directory by using the FILE or DIR constants(http://php.net/manual/en/language.constants.predefined.php).

    Try this.

    echo __FILE__;
    echo dirname(__FILE__);
    echo __DIR__;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi all i am trying to upload image file from sdcard to php server
friends, i am trying to upload file to php server using following tutorial http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html
I am trying to create a PHP file to upload images to my website.
I am trying to upload file using php. I am using the function move_uploaded_file.
I'm trying to write some PHP to upload a file to a folder on
I was trying to make a file upload form and checked the PHP documentation
I am trying to upload an image to a PHP page along with some
I'm trying to configure Netbeans for automatically upload PHP files to an SFTP server
I am trying to edit my config/database.php within my CodeIgniter project so that I
I'm trying to upload PHP file via php using ftp details as mentioned below.

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.