Questions tagged [symfony-http-foundation]

Symfony is a set of reusable PHP components. The HttpFoundation component defines an object-oriented layer for the HTTP specification.

Symfony is a set of reusable PHP components. The HttpFoundation component defines an object-oriented layer for the HTTP specification.

Useful links

61 questions
2
votes
2 answers

How to forward a Symfony Request to another server using the Http Client (with optional changes)?

How to intercept a request and send it with HttpClient to another server and return the response from that server after some modification? The original request will contain data and files. I am looking for the least verbose solution, up to copying…
2
votes
2 answers

Feature Test in Laravel 8 uses withHeader to set Host invalid?

Since my project has deployed multiple domain names, the API interface that needs to be tested is using the api.example.test domain name as the entrance. Using $this->get('/v1/ping') in Feature Test will request to www.example.test, I hope to set up…
2
votes
1 answer

Symfony HttpFoundation get single file returns null?

I use symfony HttpFoundation for upload files, the FileBag works if I call all(), but if I use get('document_name') it return null. use Symfony\Component\HttpFoundation\Request; public function saveFileAction(Request $request) { …
samius polis
  • 379
  • 5
  • 17
2
votes
1 answer

Symfony session (stand alaone) cookiename

I use the Symfony http foundation stand alone (aka i installed the http-foundation package with composer inside my non-symfony project). Ik would like to change the name of the session cookie. What would be my best way to achieve this? I read a lot…
Jasper Rooduijn
  • 141
  • 1
  • 5
2
votes
1 answer

Class 'Symfony\Component\HttpFoundation\ParameterBag' not found

I'm getting the following error when I try to run php artisan on a clean install of Laravel 5.1.43 on a Vagrant box. I've listed the versions below. PHP Fatal error: Class 'Symfony\Component\HttpFoundation\ParameterBag' not found in…
Michael
  • 4,282
  • 9
  • 55
  • 89
2
votes
0 answers

Symfony2 standalone HttpFoundation component performance loss

I'm currently developing a base application for my projects and something doesn't seem right. First of all, I'm using PHP 7, Apache. Composer is first called, it does its magic and all the goods. Then I register a Container (Illuminate) and at…
2
votes
2 answers

Symfony BinaryFileResponse cuts off end of file?

I have a ZIP File to be served via Symfony. The controller looks like this: $headers = [ 'Content-Type' => 'application/zip', 'Content-Disposition' => 'attachment; filename="archive.zip"' ]; return new…
Jarek Jakubowski
  • 948
  • 10
  • 22
2
votes
0 answers

Doctrine file uploading error

Ran into a strange problem - after submitting a form via POST with enctype="multipart/form-data", Doctrine crashes with Fatal Error: Fatal error: require(): Failed opening required…
2
votes
2 answers

pdf document - setting the window title (html header)

I'm using this to output a pdf document : $response = new \Symfony\Component\HttpFoundation\Response(file_get_contents($thefile), 200, [ 'Content-Description' => 'File transfer', 'Content-Disposition' => 'filename="' . $filename . '"', …
trogne
  • 3,402
  • 3
  • 33
  • 50
2
votes
1 answer

(Symfony 2.4) The Request Stack what is The Request Stack

About Symfony Request Stack I've read below page multiple time . and also I haven't found another blog post or some thing on web world introduce this Symfony class. "http://symfony.com/blog/new-in-symfony-2-4-the-request-stack" at the page I…
Majid Abdolhosseini
  • 2,191
  • 4
  • 31
  • 59
2
votes
1 answer

Database request in routing controller

I'm making a website with categories and products. The categories and the products are both contenttypes. Categories can't be a taxonomy type because the editor of the website has to change data for the categories. To solve this problem i created a…
user3987722
2
votes
1 answer

Picture is deleted when updating entity in symfony (Doctrine)

I have a problem with file management using Symfony (Doctrine). The point is that the files are uploaded successfully, the problem is that when I update the entity that stores the field containing the image, the image is deleted. I want to know how…
JSGarcia
  • 556
  • 7
  • 18
2
votes
2 answers

Error parsing JSON returned via Symfony Component's JsonResponse

My Ajax call: $.ajax({ url : path, type: 'POST', dataType : 'json', data: data, success: function(memberExtra) { console.log (memberExtra); } }); My response: HTTP/1.0 201 Created Cache-Control:…
Schmudde
  • 1,078
  • 1
  • 11
  • 19
1
vote
0 answers

Symfony Request::getContent(true) strange behaviour in wget but not curl

A user is able to upload a file. During the upload the file is scanned. If there is an issue with the file Symfony returns a Response(400) and the rest of the file is not uploaded, saving the user and the host time and bandwidth. This is done via…
lookbadgers
  • 988
  • 9
  • 31
1
vote
1 answer

No route found for "GET http://localhost:8000/create" after a refresh

I have two pages, one to show the list of agencies, and one to add a new one. I can easily access to http://localhost:8000/create from http://localhost:8000, but if I try to reload the page I get the error that no route found for 'GET…
JeanneMeoy
  • 15
  • 3