file-upload

How to get the filename of uploaded file in rails contoller

柔情痞子 提交于 2021-02-20 19:26:30
问题 <%= file_field 'upload' %> In my controller, if I give the following, based on suggestions filename=params[:upload] @result=filename.original_filename I am getting. undefined method `original_filename' for #<ActionController::Parameters:0x002b6c396e44b8> Note: I am not using form. Rails version is 4.0.2 回答1: Use the following code in order to get the filename: params[:file].original_filename 回答2: Have you read how to upload files in Rails? Have you set your form to multipart: true ? What will

Sending multiple files to a servlet with a single connection

心不动则不痛 提交于 2021-02-20 13:31:53
问题 I'm writing a Java desktop client which will send multiple files over the wire to a servlet using a post request. In the servlet I'm getting the input stream from the request to receive the files. The servlet will write the files to disk, one by one as they're read from the stream. The implementation has a couple of requirements: Only one HTTP request must be used to the server (so only a single stream) The servlet must use a reasonable fixed amount of memory, no matter what the size of the

Sending multiple files to a servlet with a single connection

天大地大妈咪最大 提交于 2021-02-20 13:31:40
问题 I'm writing a Java desktop client which will send multiple files over the wire to a servlet using a post request. In the servlet I'm getting the input stream from the request to receive the files. The servlet will write the files to disk, one by one as they're read from the stream. The implementation has a couple of requirements: Only one HTTP request must be used to the server (so only a single stream) The servlet must use a reasonable fixed amount of memory, no matter what the size of the

Not able to upload large files

流过昼夜 提交于 2021-02-19 08:35:07
问题 I would like to upload large amount of image file (max size 10mb) for that I am using following configuration is struts.xml <interceptors> <interceptor-stack name="fileUploadStack"> <interceptor-ref name="exception" /> <interceptor-ref name="alias" /> <interceptor-ref name="servletConfig" /> <interceptor-ref name="prepare" /> <interceptor-ref name="i18n" /> <interceptor-ref name="chain" /> <interceptor-ref name="debugging" /> <interceptor-ref name="profiling" /> <interceptor-ref name=

<Input type=“file”> not working in my WebView

…衆ロ難τιáo~ 提交于 2021-02-19 08:21:53
问题 I develop Fragment WebView Application. I use upload code in Fragment WebView. When I click <input type="file"> it is active nothing. logcat show only this warning 05-22 15:59:39.749 31611-31611/kr.nubiz.comn W/cr_Ime: updateState: type [0->0], flags [0], show [false], How can I solve this problem? WebView - Fragment private void initLayout() { handler = new Handler(); webView = (android.webkit.WebView) rootView.findViewById(R.id.webview); webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Spring Boot doesn't use CommonsMultipartResolver?

吃可爱长大的小学妹 提交于 2021-02-19 03:36:07
问题 I have a problem with REST web service running with Spring Boot (Jetty). One of my REST method is file upload and I'm guessing that CommonsMultipartResolver is not using during multipart requests. Signature of this upload method is : @ResponseBody @RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "application/json") public BaseResponse upload(@RequestParam("login") String login, @RequestParam("passwd") String passwd, @RequestParam("partner") String partner,

Spring Boot doesn't use CommonsMultipartResolver?

纵然是瞬间 提交于 2021-02-19 03:36:06
问题 I have a problem with REST web service running with Spring Boot (Jetty). One of my REST method is file upload and I'm guessing that CommonsMultipartResolver is not using during multipart requests. Signature of this upload method is : @ResponseBody @RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "application/json") public BaseResponse upload(@RequestParam("login") String login, @RequestParam("passwd") String passwd, @RequestParam("partner") String partner,

nginx file upload with client_body_in_file_only

只愿长相守 提交于 2021-02-19 02:39:34
问题 Good evening, I need to upload static content to nginx server 1.9 (so upload module didn't work with this version). I've read the article "Nginx direct file upload without passing them through backend" and followed instructions step by step. Everything works for me, except file names at the nginx data directory. File names look like '0000000001', '0061565403' and so on. What should I do to save files with their correct names? Here is my nginx location config: location /upload { limit_except

nginx file upload with client_body_in_file_only

夙愿已清 提交于 2021-02-19 02:39:18
问题 Good evening, I need to upload static content to nginx server 1.9 (so upload module didn't work with this version). I've read the article "Nginx direct file upload without passing them through backend" and followed instructions step by step. Everything works for me, except file names at the nginx data directory. File names look like '0000000001', '0061565403' and so on. What should I do to save files with their correct names? Here is my nginx location config: location /upload { limit_except

Uploading all files in a folder with windows file upload - Selenium

假装没事ソ 提交于 2021-02-18 18:51:03
问题 I am uploading files to a website using Selenium 2. I can upload one file by specifying the upload path, but I want to upload all files within a folder. Here's my code: if (driver.findElements(By.xpath("//input[@type='file']")).size() > 0) { driver.findElement(By.xpath("//input[@type='file']")).sendKeys("C:\\Users\\Bernard\\Dropbox\\Demo Submission\\Submissions\\Cooley - Imagination Land EP\\Cooley - Imagination Land.mp3"); } "Cooley - Imagination Land EP" is the folder that contains all the