file-upload

High memory usage when uploading a multipart file to Amazon S3 via streaming?

烂漫一生 提交于 2020-08-26 07:29:25
问题 The method below in my Java Spring application directly streams and uploads a file to an Amazon S3 bucket. I have researched that using streams will make the uploading of large files (> 100MB videos for my use case) to be more memory efficient. When testing the method with a 25MB file, the memory usage of my Java Spring application in a Kubernetes cluster setup spiked up by 200MB! I also tried a file that was 200MB and the memory spiked up again to ~2GB. There were no out of memory exceptions

PHP ftp_put fails

徘徊边缘 提交于 2020-08-24 04:14:42
问题 I upload XML file through FTP: $ftp = "ftp"; $username = "username"; $pwd = "password"; $filename = $_FILES[$xyz][$abc]; $tmp = $_FILES['file']['tmp_name']; $destination = "/Content/EnquiryXML "; $connect = ftp_connect($ftp)or die("Unable to connect to host"); ftp_login($connect,$username,$pwd)or die("Authorization Failed"); echo "Connected!<br/>"; if(!$filename) { echo"Please select a file"; } else { ftp_put($connect,$destination.'/'.$filename,$tmp,FTP_ASCII)or die("Unable to upload"); echo

PHP ftp_put fails

﹥>﹥吖頭↗ 提交于 2020-08-24 04:14:38
问题 I upload XML file through FTP: $ftp = "ftp"; $username = "username"; $pwd = "password"; $filename = $_FILES[$xyz][$abc]; $tmp = $_FILES['file']['tmp_name']; $destination = "/Content/EnquiryXML "; $connect = ftp_connect($ftp)or die("Unable to connect to host"); ftp_login($connect,$username,$pwd)or die("Authorization Failed"); echo "Connected!<br/>"; if(!$filename) { echo"Please select a file"; } else { ftp_put($connect,$destination.'/'.$filename,$tmp,FTP_ASCII)or die("Unable to upload"); echo

Codeigniter 4: Uploading files with move_uploaded_file

ぃ、小莉子 提交于 2020-08-20 03:02:17
问题 I just started moving CodeIgniter 3 project to CodeIgniter 4. Everything works fine except file upload. I would like to keep the user uploaded files in /writable/uploads. Below is the code I use to move the uploaded file to desired location. $target_dir = '/writable/uploads/recordings/'; $target_file = $target_dir . basename($_FILES["gfile"]["name"]); $FileType = pathinfo($target_file,PATHINFO_EXTENSION); if($FileType != "mp3") { $vmuploadOk = 1; } else $vmuploadOk = 1; if ($vmuploadOk == 1)

Codeigniter 4: Uploading files with move_uploaded_file

二次信任 提交于 2020-08-20 03:02:07
问题 I just started moving CodeIgniter 3 project to CodeIgniter 4. Everything works fine except file upload. I would like to keep the user uploaded files in /writable/uploads. Below is the code I use to move the uploaded file to desired location. $target_dir = '/writable/uploads/recordings/'; $target_file = $target_dir . basename($_FILES["gfile"]["name"]); $FileType = pathinfo($target_file,PATHINFO_EXTENSION); if($FileType != "mp3") { $vmuploadOk = 1; } else $vmuploadOk = 1; if ($vmuploadOk == 1)

How to send/post files as form data (an AJAX post) to backend service using upload collection

二次信任 提交于 2020-08-10 19:12:09
问题 I was using upload collection for uploading files/attachments as : XML : <UploadCollection id="UploadCollection" maximumFilenameLength="55" maximumFileSize="10" multiple="true" change="onChange" fileType="jpg,pdf,docx,xlsx,pptx,tif,png" fileSizeExceed="onFileSizeExceed" filenameLengthExceed="onFilenameLengthExceed" fileDeleted="onFileDeleted" selectionChange="onSelectionChange" typeMissmatch="onTypeMissmatch" uploadComplete="onUploadComplete" fileRenamed="onFileRenamed" noDataText = "No Files

Angular post-request with a multipart form has wrong content type

寵の児 提交于 2020-08-07 13:50:42
问题 I'm using the following function to upload a file to a server with the HttpClient of angular 7 pushFileToStorage(productId, key, file: File): Observable<any> { let formdata: FormData = new FormData(); formdata.append('prod', file); let url_ = '/admin5/api/v1/product/images/upload?'; url_ += "productId=" + encodeURIComponent("" + productId) + "&"; url_ += "kind=" + encodeURIComponent("" + key); return this.http.post(url_,formdata); } The problem I'm having is that the HttpClient sets the wrong

Angular post-request with a multipart form has wrong content type

[亡魂溺海] 提交于 2020-08-07 13:44:24
问题 I'm using the following function to upload a file to a server with the HttpClient of angular 7 pushFileToStorage(productId, key, file: File): Observable<any> { let formdata: FormData = new FormData(); formdata.append('prod', file); let url_ = '/admin5/api/v1/product/images/upload?'; url_ += "productId=" + encodeURIComponent("" + productId) + "&"; url_ += "kind=" + encodeURIComponent("" + key); return this.http.post(url_,formdata); } The problem I'm having is that the HttpClient sets the wrong

Upload a ZIP file and UNZIP ftp folder via PHP

|▌冷眼眸甩不掉的悲伤 提交于 2020-08-03 09:09:09
问题 I want to make a form where you can fill FTP login server and get option to upload ZIP file. The script works apart from the last part (UNZIP the file) I want to perform UNZIP uploaded file. Does anyone know what is the problem? TIA <?php if (isset($_POST['Submit'])) { $ftp_server = $ftp = $_POST['ftp']; $ftp_user_name = $username = $_POST['username']; $ftp_user_pass = $password = $_POST['password']; if (!empty($_FILES['upload']['name'])) { $ch = curl_init(); $file1 = $localfile = $_FILES[

Re-uploading a file with AJAX after it was changed causes net::ERR_UPLOAD_FILE_CHANGED in Chrome

本秂侑毒 提交于 2020-07-31 14:09:14
问题 I have a simple HTML form that sends an selected file via AJAX to an API endpoint. If I do the following steps: Press the Upload button and make an POST request to upload the file Change the selected file on the filesystem (in a text editor), without picking it again in the file picker. Press the Upload button again, and make as second POST request Chrome will fail the second request with an error: net::ERR_UPLOAD_FILE_CHANGED . Note that if you change the file before the initial upload, the