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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:12:07+00:00 2026-05-20T15:12:07+00:00

I have a form where users can upload an image. I have another page

  • 0

I have a form where users can upload an image. I have another page which already works that then creates a directory and places the image in it. For some reason, when I copy that same code to my current page, it gives me the following error:

Warning: mkdir() [function.mkdir]: No
such file or directory in
/home5/ideapale/public_html/amatorders_final/user_char_upload.php
on line 251

Here is the code it is referring to:

if (!file_exists("../upload/" . $order_id . '_' . $row['last_name'])) { //Checks if the directory already exists
    mkdir("../upload/" . $order_id . '_' . $row['last_name'], 0755); //Creates a new directory with the order_id and Customer last name
}

I tried echoing out all those variables, so I know they work.

It seems pretty straighforward to me, so i’m not sure why the mkdir function isn’t working for me on this page. Any ideas anyone?

  • 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-20T15:12:08+00:00Added an answer on May 20, 2026 at 3:12 pm

    Using mkdir with two parameters, in order to create the directory a/b/c, the directory a/b must exist.

    If you want a/b to be created when you try to create a/b/c, you need to pass true as a third parameter (the one called recursive 😉 ) to mkdir.

    If you `upload` directory already exists, then, you need to make sure that `../upload/` is actually what you think.

    This ../upload/ is relative to the current directory of execution (which is not necessarily the same as the one that contains your script !)

    You might want to try using this :

    var_dump(realpath('../upload/'));
    

    to check if that directory is what you think — it’ll display its full path if it exists ; or false if it doesn’t.

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

Sidebar

Related Questions

We have got a setup where users can either use a web-based form or
I have a form a user can enter their name, then it will add
I have a form in which the user can choose a component type from
I have a view user control that can post form. This control can be
I have a form with a textarea. Users enter a block of text which
On a website if I have a form where the user can input some
I have a form in HTML where our users fill in the data and
We have a simple registration form for our website users where we only require
I have a form that uses jQuery to submit an ajax post and it
The basics: I have a contact form that uses php to validate the forms.

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.