Comments (10)
Hmm, not really sure. Can you post the code from your form? The FILES array isn't usually shown. Are you passing the file to a view or something?
Just the regular config?
from laravel-debugbar.
This is the form:
{{ Form::open(array('url' => URL::to("downloadscp/upload"), 'files' => true)) }}
...some text inputs....
{{ Form::file("file") }}
{{ Form::submit("Save", array("class" => "btn fright")) }}
{{ Form::close() }}
Controller:
$validator = ValidatorService::validateFileUpload();
if ($validator->passes())
{
$file = Input::file("file");
$dl = new Download;
$dl->display_name = e(Input::get("display_name"));
$dl->filename = $file->getClientOriginalName();
$dl->mime = $file->getMimeType();
$dl->size = $file->getClientSize();
$dl->description = e(Input::get("description"));
$dl->link=null;
$dl->category_id = Input::get("category");
$dl->priority = Input::get("priority");
$dl->added_time = date("Y-m-d H:i:s");
$dl->added_by = Auth::user()->id;
$dl->num_downloads = 0;
$path = $file->getRealPath();
$dl->data = file_get_contents($path);
$dl->sha1 = sha1_file($path);
$dl->save();
success("File uploaded");
return Redirect::to("downloadscp/upload");
}
else
{
return Redirect::to("downloadscp/upload")->withErrors($validator)->withInput();
}
No special configuration as far as I know.
from laravel-debugbar.
And a specific file that is causing trouble, or all files?
Op 4 nov. 2013 18:02 schreef "Eurobattle.net" [email protected]:
This is the form:
{{ Form::open(array('url' => URL::to("downloadscp/upload"), 'files' =>
true)) }}
...some text inputs....
{{ Form::file("file") }}
{{ Form::submit("Save", array("class" => "btn fright")) }}
{{ Form::close() }}Controller:
$validator = ValidatorService::validateFileUpload();
if ($validator->passes())
{
$file = Input::file("file");
$dl = new Download;
$dl->display_name = e(Input::get("display_name"));
$dl->filename = $file->getClientOriginalName();
$dl->mime = $file->getMimeType();
$dl->size = $file->getClientSize();
$dl->description = e(Input::get("description"));
$dl->link=null;
$dl->category_id = Input::get("category");
$dl->priority = Input::get("priority");
$dl->added_time = date("Y-m-d H:i:s");
$dl->added_by = Auth::user()->id;
$dl->num_downloads = 0;
$path = $file->getRealPath();
$dl->data = file_get_contents($path);
$dl->sha1 = sha1_file($path);
$dl->save();
success("File uploaded");
return Redirect::to("downloadscp/upload");
}
else
{
return
Redirect::to("downloadscp/upload")->withErrors($validator)->withInput();
}No special configuration as far as I know.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-27702221
.
from laravel-debugbar.
Yes, it seems that file is being passed back to the view because of ->withInput()
Only binary files fail. Text files are ok. I am checking now why exactly the validator fails in the first place.
edit: see next comment
from laravel-debugbar.
Ok, I changed the redirect to ->withInput(Input::except("file")); so now the file is not being passed back if validator fails.
But this does not seem to be the problem. The validator passes fine and all steps are completed, all info is in the database. Just the debugbar crashes, everything else is executing fine.
from laravel-debugbar.
Can you try disabling the data collectors in the debugbar config to see
what collector is causing trouble?
Op 4 nov. 2013 18:17 schreef "Eurobattle.net" [email protected]:
Ok, I changed the redirect to ->withInput(Input::except("file")); so now
the file is not being passed back if validator fails.But this does not seem to be the problem. The validator passes fine and
all steps are completed, all info is in the database. Just the debugbar
crashes, everything else is executing fine.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-27703470
.
from laravel-debugbar.
It is the db collector.. and I know why. I am saving the files in LARGEBLOB field in database. This must be the problem.
from laravel-debugbar.
Ok, pushed a possible fix to php-debugbar upstream.
from laravel-debugbar.
Is merged, is this better?
from laravel-debugbar.
I will do some tests and report back.
from laravel-debugbar.
Related Issues (20)
- 3.9.x throwing console error HOT 11
- Debugbar not working for subdomain (multi tenant) HOT 8
- error when using blade render with cache clean option HOT 1
- DEBUGBAR can be ABUSED to obtain USER Credentials! HOT 2
- object data view reseting HOT 4
- !! To enable public access to previous requests, set debugbar.storage.open to true in your config, or enable DEBUGBAR_OPEN_STORAGE if you did not publish the config. !! HOT 10
- Track queries when using DB raw pdo HOT 5
- Debugbar isn't displaying session arrays in Session-tab HOT 8
- debuge bae not showing all thbe data HOT 2
- Debugbar queries replaced by one backslash instead of two HOT 1
- JQuery Ajax is ignored HOT 6
- When capturing AJAX, leave the debug view on the selected request. HOT 4
- "Queries" in debugbar does not show the query HOT 1
- Queries in providers HOT 10
- Can't select or copy SQL query from debug bar. HOT 2
- Debuuger bar not show on dompdf HOT 3
- Laravel debugbar HOT 1
- Debugbar text is not visible on timeline when theme was set to dark mode. HOT 4
- Debugbar stopped working with Livewire 3 HOT 6
- Maximum execution time of 30 seconds exceeded HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-debugbar.