upload

Processing PLUpload uploads with node.js

我是研究僧i 提交于 2019-12-06 14:05:26
I'm attempting to create a server-side upload component in node.js, but I'm having trouble interpreting the information sent from PLUpload. From what I can tell, PLUpload (in HTML5 mode) sends files as binary information, which creates problems for the node.js packages I've been attempting to use so far (node-formidable and node-express), as they expect normal HTML uploads with multipart content types. For what it's worth, this is the code I've been attempting to use... var formidable = require('formidable'); var sys = require('sys'); http.createServer( function( req, res ){ console.log(

upload video using Retrofit 2

本小妞迷上赌 提交于 2019-12-06 13:55:47
问题 I want to upload a video file using Retrofit 2 , please help me doing this. This is my endpoint: upload.php : <?php $uploaddir = '../uploads/'; $uploadfile = $_FILES['userfile']['name']; $response = array(); if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.$uploadfile)) { $response["result"] = "1"; echo json_encode($response); } else { $response["result"] = "-1"; echo json_encode($response); } ?> I tried to follow a sample (combining it with file selection from the gallery)

Strange CodeIgniter file upload error

我怕爱的太早我们不能终老 提交于 2019-12-06 13:33:50
I've set up 'Uploadify' to upload files to my server where I process them with CodeIgniter's file upload library. However, I think Uploadify changes the mime type of the files, or does something else weird which causes CodeIgniter to give a 'the file type is not allowed' error despite it being allowed. E.g I've allowed JPEG files but when I upload them using Uploadify, I get that error. Is there any workaround for this? Basically, I want only image uploads to be allowed, e.g .jpg, .jpeg, .bmp, .png. Do I have to manually check the extension of the files or is there any better option? You're

Uploading a Base64 encoded Image to PHP server

不羁岁月 提交于 2019-12-06 13:27:54
问题 I'm trying to upload a Base64 encoded .Png file to a PHP server from an Android application. Below code doesn't return anything in the response. What am I doing wrong? I'm sending the Base64 encoded string and the name of the file. (ex:"sign1234.png") <?php if(isset($_POST['image']) && isset($_POST['name']){ $image = $_POST['image']; $name = $_POST['name']; $png = base64_to_jpeg($image,$name); $target = 'uploads/'.$name; $result = move_uploaded_file( $_FILES['$png']['tmp_name'], $target); if(

ftps.storlines socket.timeout despite file upload completing

旧城冷巷雨未停 提交于 2019-12-06 12:54:14
问题 I'm trying to upload a CSV file using ftplib.FTP_TLS, however regardless of the timeout duration I set (5,10,60 seconds), the code always times out with the error: File "/usr/lib/python3.4/ftplib.py", line 544, in storlines conn.unwrap() File "/usr/lib/python3.4/ssl.py", line 788, in unwrap s = self._sslobj.shutdown() socket.timeout: The read operation timed out However after the timeout, I check the directory through Cyberduck, and the CSV file is there, complete. Here is my upload code: def

HTML/CSS - Using a image for input type=file

耗尽温柔 提交于 2019-12-06 12:13:47
How do use this image: http://h899310.devhost.se/proxy/newProxy/uplfile.png Instead of the regular: <input type="file" /> Have a look at Styling an input type="file" . I'm not very sure on whether you want to style file upload fields, or whether you simply want to use a png file in a style. Quirksmode.org has a section on styling file upload fields though, that you would want to refer to. If you want to use the PNG file to use in a style inside a page, you should like at how to set backgrounds using images, although this may not work for all HTML elements. I did something like this and it

AjaxFileUpload return download panel when data is json

坚强是说给别人听的谎言 提交于 2019-12-06 12:07:53
I use AjaxFileUpload ( http://www.phpletter.com/Our-Projects/AjaxFileUpload/ ) to upload a file and get json result type response in struts2 ( code.google.struts2jsonresult.JSONResult ) but browser always pop-up download pane, plz give me some suggestions, thanks in advance Here is my config in struts.xml : ...... <result-type name="json" class="code.google.struts2jsonresult.JSONResult"> ............ <action name="doGetList" method="doGetList" class="main.java.GetListAction"> <result type="json"> <param name="target">jsonObject</param> <param name="deepSerialize">true</param> <param name=

getting my rails app to accept large files

允我心安 提交于 2019-12-06 11:58:29
I'm developing a rails app where users will be able to upload files. Currently I have my files on an online IDE called nitrous.io. When I upload a file above 17MB in size (or a combination of files like that). I get an error that says: 413 Request Entity Too Large openresty/1.7.10.1 I did some reading and found out that this is a result of the client_max_body_size needing to be set in nginx.conf to an appropriate size. I went on and found that nginx is part of openresty and so the nginx.conf file was located in /etc/nginx/ , added the line client_max_body_size = 50M; To the file and now it

wordpress multisite remove /sites/{ID}/ automatic upload url

家住魔仙堡 提交于 2019-12-06 11:10:01
when using wp multisites it gets messed up pretty fast. Is there any solution available removing the automatic /sites/{id}/ folder structure? I'm able to adjust the site-upload-dir within site-settings but it always adds " /sites/{id}/ " to the uploaded file through the media-manager. Is there any snippet available removing/disabling these extra folder structure? First I ended up changing the core in wp-includes/functions.php in order to disable the addition: if ( defined( 'MULTISITE' ) ) $ms_dir = '/sites/' . get_current_blog_id(); else $ms_dir = '/' . get_current_blog_id(); And one line

Rename image file on upload php

与世无争的帅哥 提交于 2019-12-06 10:53:15
问题 I have a form for uploading image. The index.html submits data to resizer.php. The coding is as follows; index.html <form action="resizer.php" method="post" enctype="multipart/form-data"> Image: <input type="file" name="file" /> <input type="submit" name="submit" value="upload" /> </form> resizer.php <?php require_once('imageresizer.class.php'); $imagename = "myimagename"; //Path To Upload Directory $dirpath = "uploaded/"; //MAX WIDTH AND HEIGHT OF IMAGE $max_height = 100; $max_width = 100; /