質問編集履歴
2
自己解決コードの記述
test
CHANGED
File without changes
|
test
CHANGED
@@ -155,3 +155,61 @@
|
|
155
155
|
Content-Disposition: form-data; name="sendData"; filename="sendData.xml"
|
156
156
|
|
157
157
|
Content-Type: text/xml
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
###追記2
|
162
|
+
|
163
|
+
下記のように記述したところ無事解決しました。
|
164
|
+
|
165
|
+
ご回答ありがとうございました_(._.)_
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
```php
|
170
|
+
|
171
|
+
$url = "送り先";
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
$boundary = "---------------------".substr(md5(rand(0,32000)), 0, 10);
|
176
|
+
|
177
|
+
$boundaryMod = "--" .$boundary;
|
178
|
+
|
179
|
+
$xmlData = file_get_contents("data.xml");
|
180
|
+
|
181
|
+
$postdata = "";
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
$postdata .= "$boundaryMod\n";
|
186
|
+
|
187
|
+
$postdata .= 'Content-Disposition: form-data; name="sendData"; filename="data.xml"' ."\n";
|
188
|
+
|
189
|
+
$postdata .= 'Content-Type: text/xml' ."\n\n";
|
190
|
+
|
191
|
+
$postdata .= $xmlData . "\n";
|
192
|
+
|
193
|
+
$postdata .= "\n" .$boundaryMod. "--" ."\n";
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
$ch = curl_init($url);
|
198
|
+
|
199
|
+
curl_setopt($ch, CURLOPT_POST, true);
|
200
|
+
|
201
|
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
202
|
+
|
203
|
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data; boundary=' .$boundary. ' ', 'Cache-Control: no-store,no-cache', 'Accept: text/*', 'Paragma: no-cache'));
|
204
|
+
|
205
|
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
|
206
|
+
|
207
|
+
$result = curl_exec($ch);
|
208
|
+
|
209
|
+
curl_close($ch);
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
echo $result;
|
214
|
+
|
215
|
+
```
|
1
追記の記述
test
CHANGED
File without changes
|
test
CHANGED
@@ -141,3 +141,17 @@
|
|
141
141
|
}
|
142
142
|
|
143
143
|
```
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
###追記
|
148
|
+
|
149
|
+
おそらく、このような情報が付与できれば良いとは思うのですが、どのようにしてよいのか…
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
----------------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6
|
154
|
+
|
155
|
+
Content-Disposition: form-data; name="sendData"; filename="sendData.xml"
|
156
|
+
|
157
|
+
Content-Type: text/xml
|