file-upload

How to upload to OneDrive using Microsoft Graph Api in c#

十年热恋 提交于 2020-07-10 08:25:08
问题 I have been trying to upload to a OneDrive account and I am hopelessly stuck not being able to upload neither less or greater than 4MB files. I have no issues accessing the drive at all, since I have working functions that create a folder, rename files/folders, and a delete files/folders. https://docs.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=csharp This documentation on Microsoft Graph API is very friendly to HTTP code, and I believe I am able to fairly

webapi core unable to upload large file blocked by cors policy

只谈情不闲聊 提交于 2020-07-10 06:08:08
问题 I am trying to upload large files from an Angular 9.0 front end to a Web Api .net core 3.1 back end. I am following this tutorial https://code-maze.com/upload-files-dot-net-core-angular/. It all works perfect up to the default max file size of 28.6 mb, once I go above this file size I get the following cors error: 'Access to XMLHttpRequest at [localhost] from origin [localhost] has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.'

webapi core unable to upload large file blocked by cors policy

我是研究僧i 提交于 2020-07-10 06:07:29
问题 I am trying to upload large files from an Angular 9.0 front end to a Web Api .net core 3.1 back end. I am following this tutorial https://code-maze.com/upload-files-dot-net-core-angular/. It all works perfect up to the default max file size of 28.6 mb, once I go above this file size I get the following cors error: 'Access to XMLHttpRequest at [localhost] from origin [localhost] has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.'

Get filename of failed uploaded file in laravel 5.4

早过忘川 提交于 2020-07-05 12:50:09
问题 How do i get the filename of failed uploaded file and pass it on validation error message. Ex: "The file.0 must be 1024 kilobytes." be like "The failed-file-sample.jpg must be 1024 kilobytes." Here's the sample code arrangement: $messages = [ 'mimes' => 'File(s) must be of type: :values.', 'size' => 'The ' . $request->file('file_field')->getClientOriginalName() . ' must be :size kilobytes.' ]; $this->validate( request(), ['file_field' => 'bail|required|mimes:gif,jpg,jpeg,png|size:1024'],

How do I upload a file using http post? Delphi 2009

人走茶凉 提交于 2020-07-05 07:26:56
问题 My goal is to upload a text file via HTTP post I am using Delphi 2009. Say for example to the following URL https://www.example.com/ex/exampleAPI.asmx/Process I understand it can be done by using the TIdHttp component. And the following call IdHttp1.Post(); But I cant figure out how to set up everything i.e. specifying the url and including the file to be posted. Thanks. 回答1: TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1

How do I upload a file using http post? Delphi 2009

偶尔善良 提交于 2020-07-05 07:25:10
问题 My goal is to upload a text file via HTTP post I am using Delphi 2009. Say for example to the following URL https://www.example.com/ex/exampleAPI.asmx/Process I understand it can be done by using the TIdHttp component. And the following call IdHttp1.Post(); But I cant figure out how to set up everything i.e. specifying the url and including the file to be posted. Thanks. 回答1: TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1

REST API - file (ie images) processing - best practices

江枫思渺然 提交于 2020-07-04 04:37:11
问题 We are developing server with REST API, which accepts and responses with JSON. The problem is, if you need to upload images from client to server. Note: and also I am talking about a use-case where the entity (user) can have multiple files (carPhoto, licensePhoto) and also have other properties (name, email...), but when you create new user, you don't send these images, they are added after the registration process. The solutions I am aware of, but each of them have some flaws 1. Use

adding timestamp while uploading image file is not working

天涯浪子 提交于 2020-06-29 03:41:55
问题 I am developing a ad site that anyone able to upload 3 images. So I am coding to upload that 3 images by adding timestamp in front of their file name to make them unique. I use codeigniter framework and attaching the code below. when I submitting form data, localhost server shows that images have been saved correctly with some code infornt of image filename. But problem is there are no images saved in relevant image folder in that name and I cannot retrieve that images in next preview

Uploading Files in Django - How to avoid the increase of files in the upload directory

泪湿孤枕 提交于 2020-06-28 06:34:48
问题 I've been working on uploading a file on Django. I have the following code to run things. def handle_uploaded_file(file, filename): if not os.path.exists('upload/'): os.mkdir('upload/') with open('upload/' + filename, 'wb+') as destination: for chunk in file.chunks(): destination.write(chunk) def upload_csv(request): # Get the context from the request. context = RequestContext(request) if request.is_ajax(): if "POST" == request.method: csv_file = request.FILES['file'] my_df = pd.read_csv(csv

upload image from multipart-from-data using Alamofire '~> 5.0.0-beta.3'

有些话、适合烂在心里 提交于 2020-06-27 17:12:14
问题 func uploadImage(image: UIImage, imageUrl: String, imageExtension: String , responseData: @escaping (_ response: UploaderModel)-> ()) { var status : UploaderModel? let token = UserDefaults.standard.string(forKey: PrefKeys.loginToken) ?? "" let authorization = ["Authorization" : "Bearer \(token)"] let imageURl = "http://68.183.152.132/api/v1/stuff/uploader" //Parameter HERE let parameters = [ "garbageCollector": 0, "stuff_uuid": "2b4b750a-f4a6-4d61-84ce-7c42b5c030ee", "delete_file" : "" ] as