This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:convert'; | |
| import 'package:http/http.dart' as http; | |
| class HttpUploadService { | |
| Future<String> uploadPhotos(List<String> paths) async { | |
| Uri uri = Uri.parse('http://10.0.0.103:5000/profile/upload-mutiple'); | |
| http.MultipartRequest request = http.MultipartRequest('POST', uri); | |
| for(String path in paths){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:app_upload/common/card_picture.dart'; | |
| import 'package:app_upload/common/take_photo.dart'; | |
| import 'package:app_upload/service/dio_upload_service.dart'; | |
| import 'package:app_upload/service/http_upload_service.dart'; | |
| import 'package:camera/camera.dart'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:camera/camera.dart'; | |
| import 'package:flutter/material.dart'; | |
| class TakePhoto extends StatefulWidget { | |
| final CameraDescription? camera; | |
| TakePhoto({this.camera}); | |
| @override | |
| _TakePhotoState createState() => _TakePhotoState(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io'; | |
| import 'package:flutter/material.dart'; | |
| class CardPicture extends StatelessWidget { | |
| CardPicture({this.onTap, this.imagePath}); | |
| final Function()? onTap; | |
| final String? imagePath; | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function drawStepPolyline(path, map) { | |
| new google.maps.Polyline({ | |
| path: path, | |
| strokeColor: '#f00', | |
| strokeWeight: 5, | |
| zIndex: 99, | |
| map: map | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const nodemailer = require('nodemailer'); | |
| const transporter = nodemailer.createTransport({ | |
| service: 'gmail', | |
| auth: { | |
| user: '[email protected]', | |
| pass: 'yourpassword', | |
| }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; | |
| import { HttpClient, HttpEventType } from '@angular/common/http'; | |
| @Component({ | |
| selector: 'app-home', | |
| templateUrl: './home.component.html', | |
| styleUrls: ['./home.component.scss'] | |
| }) | |
| export class HomeComponent implements OnInit { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h2>Angular File Upload</h2> | |
| <form (submit)="sendFile()" id="upload_form" enctype="multipart/form-data" method="post"> | |
| <input #inputFile type="file" name="file1" id="file1"><br> | |
| <progress #progressBar id="progressBar" value="0" max="100" style="width:300px;"></progress> | |
| <h3 id="status">{{ status }}</h3> | |
| <p id="loaded_n_total">{{ uploadStatus }}</p> | |
| <hr /> | |
| <button type="submit">Enviar arquivo</button> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <main> | |
| <h2>VueJS File Upload</h2> | |
| <form @submit="sendFile($event)" id="upload_form" enctype="multipart/form-data" method="post"> | |
| <input ref="inputFile" type="file" name="file1" id="file1"><br> | |
| <progress ref="progressBar" id="progressBar" value="0" max="100" style="width:300px;"></progress> | |
| <h3 id="status">{{ status }}</h3> | |
| <p id="loaded_n_total">{{ progressText }}</p> | |
| <hr /> | |
| <button type="submit">Enviar arquivo</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _(el) { | |
| return document.getElementById(el); | |
| } | |
| function uploadFile() { | |
| var file = _("file1").files[0]; | |
| // alert(file.name+" | "+file.size+" | "+file.type); | |
| var formdata = new FormData(); | |
| formdata.append("file", file, "video.mov"); | |
| var ajax = new XMLHttpRequest(); |