Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload file not detected by request laravel #324

Closed
1 task
rymesaint opened this issue Jun 2, 2019 · 3 comments
Closed
1 task

Upload file not detected by request laravel #324

rymesaint opened this issue Jun 2, 2019 · 3 comments

Comments

@rymesaint
Copy link

rymesaint commented Jun 2, 2019

New Issue Checklist

  • I have searched for a similar issue in the project and found none

Issue Info

Info Value
Platform Name flutter
Platform Version 1.5.4-hotfix2
Dio Version 2.1.0
Android Studio / Xcode Version Visual Studio Code
Repro rate sometimes
Repro with our demo prj -
Demo project link -

Issue Description and Steps

FormData formData = FormData.from({
        'photo': UploadFileInfo(photo, basename(photo.path))
      });

Response response;
    try {
      response =  await _dio.post(url, data: formData, options: Options(
        headers: headers,
      ),
      onSendProgress: onSendProgress
      );
    } on DioError catch(e) {
      if(e.response != null) {
        throw Exception(e.response.data['meta']['message']);
      }
    }
    return response;

I have a problem with sending data from flutter android to backend laravel using $request->file('photo') the file data is always null, and then i found the problem that dio can only accepted by native php $_FILES instead using $request->file('photo') in laravel. Can you make it somehow when dio sending request to laravel backend $request->file so that it can accept the file.

@wendux
Copy link
Contributor

wendux commented Jun 4, 2019

@stale
Copy link

stale bot commented Jul 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

@stale stale bot added the stale label Jul 5, 2019
@stale stale bot closed this as completed Jul 13, 2019
@gioVerdiansyah
Copy link

there are new update? I got some error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants