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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:17:29+00:00 2026-06-13T08:17:29+00:00

Im trying to perform a file upload and am having truble generating a route

  • 0

Im trying to perform a file upload and am having truble generating a route to tell the move_uploaded_file where to move the file. In my routing file (from within the bundle) i have:

endorsement_pics:
    pattern:  /images
    defaults: { _resource: EndorseMeEndorsementBundle/Resources/public/images/endorsement_images }

And i do:

        $url = $this->get('router')->generate('endorsement_pics');

Which generates the literal url http://www.example.com/endorsement/images

And the function

            move_uploaded_file($_FILES['endorsement_image']['tmp_name'], $url."image1.jpg");

Which gives me the error:

                Warning: move_uploaded_file(/newsite/web/app_dev.php/endorsement/imagesimage1.jpg) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: No such file or directory in /home/content/24/9254124/html/newsite/src/EndorseMe/EndorsementBundle/Controller/DefaultController.php line 20

Any ideas?

  • 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-13T08:17:30+00:00Added an answer on June 13, 2026 at 8:17 am

    You can’t move a file to a URL — it has to be a filesystem path. Using routes for this is wrong.

    To upload a file to the public web folder, you could do the following. First, create a parameter in parameters.yml for the upload directory path:

    parameters:
        upload_dir: %kernel.root_dir%/../web/uploads
    

    Then use the parameter for an upload:

    $uploadDir = $this->container->getParameter('upload_dir');
    move_uploaded_file(
        $_FILES['endorsement_image']['tmp_name'], 
        $uploadDir . '/image1.jpg'
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to perform a JNDI-lookup from within the GWT devmode. I have
I'm trying to perform the acquisition of data from the internet on the load
I am trying to perform a search for documents within a SharePoint site, but
I'm trying to upload a file onto my personal server. I've written a small
Am trying to perform a select into outfile, am having following errors My request:
Trying to perform a pull from a remote repository, however the relevant code is
I am trying to perform a simple file copy task under Windows and I
I'm trying to perform barcode recognition on a multipage tiff file. But the tiff
I am using JDK 7 and I am trying to perform a simple write-to-file
I am having frustrating issues with trying to perform a highly concurrent test using

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.