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 7975443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:38:20+00:00 2026-06-04T08:38:20+00:00

Sorry if the title sounds a bit vague. Stackoverflow posting newbie here. I have

  • 0

Sorry if the title sounds a bit vague.

Stackoverflow posting newbie here.

I have an address book that I am building and have run into a bit of a problem.

I want to be able to update the record and if no image is set in the update form, to keep the image already noted in the record. If the image field is populated, then update the record with that image and move it to the target location.

This is the if statement I have for it:

if (empty($photo))
{
$photo = $row['photo'];
}
else
{           
$phmsg = "Photo $photo has been deleted and replaced";
unlink("".IMAGES."/$photo");
$afn = date('dmYHis');
$name_of_file = $_FILES['photo']['name'];
$photo=$afn.$name_of_file;
$target = "".FILE_UPLOAD."/"; 
$target = $target . basename($photo);
}

This is the error I get when I try to run the upload:

Warning: move_uploaded_file() [function.move-uploaded-file]: Filename cannot be empty in C:\xampp\htdocs\cab\update.php on line 165

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘C:\xampp\tmp\phpB232.tmp’ to ” in C:\xampp\htdocs\cab\update.php on line 165

File was not uploaded. Please try a manual upload.

The only other way around it that I can see is to have a seperate file for updating and not updating the picture.

Any help would be most welcome and very much appreciated.

Thanks in advance

  • 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-04T08:38:22+00:00Added an answer on June 4, 2026 at 8:38 am

    You are trying to use move_uploaded_file() without a valid file as parameter.

    Check if you have a valid file uploaded, and only then execute move_uploaded_file()

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

Sidebar

Related Questions

Sorry the title is very vague. Basically, I'm stuck with something. I have an
Sorry if that title doesn't make sense, I'm new to Rails and I'm building
Sorry the title is a little bit long. So I have a twitter account
My question title sounds a little bit difficult - sorry. I'm new in MEF
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry for title, I have an interop problem. The C dll that I'm using
Sorry if the title is a little vague, I have the following sceneraio: I
First of all Sorry if my question title sounds stupid.... I have the following
Sorry if the title sounds confusing - but this is what I am trying
Sorry if the title doesn't make sense. Basically I have a series of strings

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.