小编Dej*_*pan的帖子

AngularJS:如何通过$ resource在POST中发送图像文件?

我正在尝试使用$ resource发出http请求,这将发送此邮递员请求所执行的相同信息.当然,我做得不对.

这是我需要复制的请求:

邮差要求:http://i.stack.imgur.com/9zgnF.jpg

邮差标题:http://i.stack.imgur.com/oRG0m.jpg

的index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title>File Upload</title>

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script …
Run Code Online (Sandbox Code Playgroud)

javascript resources http multipartform-data angularjs

2
推荐指数
1
解决办法
7167
查看次数