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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:17:24+00:00 2026-05-16T01:17:24+00:00

I found the post about adding attachments to the mail. The question is how

  • 0

I found the post about adding attachments to the mail. The question is how to connect uploaded file with that function? What I have to pass?


UPD:

echo '<pre>';
print_r($_FILES);
echo '</pre>';

$uploads_dir = '/uploads'; // It has need rights

$tmp_name = $_FILES["vac_file"]["tmp_name"];
$res = is_uploaded_file($tmp_name); // This is true
$name = $_FILES["vac_file"]["name"];

move_uploaded_file($tmp_name, "$uploads_dir/$name");
echo '$tmp_name: '. $tmp_name . '; $name: ' . $name;

→

Array
(
    [vac_file] => Array
        (
            [name] => LFS.desktop
            [type] => application/octet-stream
            [tmp_name] => /tmp/phpV417nF
            [error] => 0
            [size] => 226
        )

)

yeah!
Warning: move_uploaded_file(/uploads/LFS.desktop): failed to open stream: No such file or directory in /srv/http/vacancies_attachment.php on line 47 Warning: move_uploaded_file(): Unable to move '/tmp/phpV417nF' to '/uploads/LFS.desktop' in /srv/http/vacancies_attachment.php on line 47 $tmp_name: /tmp/phpV417nF; $name: LFS.desktop
  • 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-16T01:17:25+00:00Added an answer on May 16, 2026 at 1:17 am

    Use move_uploaded_file() to move the file to a temporary location; attach it to the mail from there and delete it afterwards (or keep it, whatever you want to do).

    See the PHP manual on file uploads for a detailed example.

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

Sidebar

Related Questions

I have read nearly every single post about the activity not found to handle
Morning, simple stupid question. I have found post with similar issues but after reading
I found this post that shows how to pass multiple check box selections to
I found a post about users that wanted to use grep in PowerShell. For
I found some interesting post about memory usage and CPU usage here on Stack
I recently found this post . It basically says that Eclipse has a modified
Im very new in C++ I have found this post http://msdn.microsoft.com/en-us/magazine/cc163486.aspx and trying to
I found a post about how to kill the program itself one year ago.
Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed
I know adding static member function is fine, but how about an enum definition?

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.