upload

Android, uploading a photo to host on imgur programatically

怎甘沉沦 提交于 2019-12-01 05:58:39
I have tried different methods to upload and retrieve a link via imgur but none have been successfull despite looking at the imgur api. http://api.imgur.com/examples#uploading_java But the following methods partly works.. im trying to retrieve, errors: if any errors occured. link to image: the link to the image hosted delete link: the link to delete the image hosted But i only end up with the "delete link", as the others are blank, check it out: public void post(String path) { List<NameValuePair> postContent = new ArrayList<NameValuePair>(2); postContent.add(new BasicNameValuePair("key", DEV

Security: How to validate image file uploads?

≡放荡痞女 提交于 2019-12-01 05:55:36
I need to accept image file uploads from the users. How can I check and be 100% sure that I don't get a malicious file or something? Check the mime type? Re-draw the image? Anti-virus? Redraw the image, read it up with GD 's imagecreatefromXXX() and save it back with imageXXX() This way you can also scale it to more convenient sizes and keep bandwidth consumption in check. To save on computing power, deny upload to files bigger than a certain limit. 5megs or 10megs should be fine, as limits go. Keep GD updated, and be wary that (7 years ago, apparently) it used to sport buffer overflows in the

AJAX/PHP based upload with progress bar for large files

我的梦境 提交于 2019-12-01 05:47:15
问题 I've been trying to create a non-flash upload panel which also shows a progress bar. On our server we have PHP 5.3 (cannot upgrade to 5.4 for now, so the new upload progress feature cannot be used => http://php.net/manual/en/session.upload-progress.php). We cannot use flash based solutions, extensions or similar. Hence I've tried using an XMLHttpRequest combined with AJAX. The problem here is that I've only achieved partial success. I've managed to upload and save on the server a file of

WebView Android 4.0 file upload

Deadly 提交于 2019-12-01 05:26:37
It's just NOT working. I'm doing this webView.setWebChromeClient(new WebChromeClient() { public void openFileChooser(ValueCallback<Uri> uploadFile) { System.out.println("openFileChooser"); mUploadMessage = uploadFile; Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.addCategory(Intent.CATEGORY_OPENABLE); i.setType("file/*"); PresentationActivity.this.startActivityForResult( Intent.createChooser(i, "Image Browser"), FILECHOOSER_RESULTCODE); } }); but openFileChooser is never called. Any ideas? openFileChooser is marked @hide in Android source code. I think its because you should NOT use this

EPIPE (Broken pipe) while uploading?

时光怂恿深爱的人放手 提交于 2019-12-01 05:06:05
问题 i have a problem in my code but i don't know where is it the E log report 04-08 05:47:46.745: E/Upload Server(20080): Starting : /storage/sdcard1/Music/Piano (my favourites)/11 Tchaikovsky - The Music Lovers.mp3 04-08 05:47:47.136: E/Upload Server(20080): Connection Error : sendto failed: EPIPE (Broken pipe) what is (EPIPE) ? , when i attempt to upload image its upload successfully but any other file E Cat report (Broken pipe) why ! this is my uploading code @Override protected String

Limit Struts2 file upload max size without uploading the whole file

自古美人都是妖i 提交于 2019-12-01 05:00:29
问题 I am trying to implement a file upload in JSP/Struts2, and I noted a strange behaviour. I declared my action that way in struts.xml to limit file size to 1MB <action name="massInsert" class="massInsertAction"> <interceptor-ref name="fileUpload"> <param name="allowedTypes"> image/png,image/gif,image/jpeg </param> <param name="maximumSize">1000000</param> </interceptor-ref> <interceptor-ref name="defaultStack"/> <result name="success">/WEB-INF/jsp/massInsert/massInsert.jsp</result> <result name

HTML file input field with limited file types?

核能气质少年 提交于 2019-12-01 04:59:22
问题 If I have an HTML file input field, is there any way that I can limit it to only allow image uploads? I'm sure this would be possible with Flash or Java, but I'm trying to stay away from them for the time being. I found the "accept" attribute online, but it doesn't seem to be doing anything for me (or I'm using it wrong.). Any help or examples is appreciated. 回答1: The best way is to handle that in the backend. Depending on the type of types you want to allow and the backend technology you

php str_getcsv array issue

你。 提交于 2019-12-01 04:38:07
I am uploading a csv file and then parsing it using str_getcsv. All works great except that I need a way to cycle through them. Ideally, it'd be great to have the array come back and look like this: Array ( [1] => Array ( [0] => 1 // first id in csv [1] => name [2] => address [3] => town [4] => state [5] => zip [6] => phone [7] => website [8] => other [9] => other ) [22] => Array ( [10] => name [11] => address [12] => town [13] => state [14] => zip [15] => phone [16] => website [17] => other [18] => other ) [24] => Array ( [19] => name [20] => address [21] => town [22] => state [23] => zip [24

Heroku django project read-only file system

风流意气都作罢 提交于 2019-12-01 04:08:56
I'm deploying django project on heroku, it works fine, but in django admin, when i'm trying to upload image i got error: OSError at /admin/blocks/block/add/ [Errno 30] Read-only file system: '/home/goldwedd' This is by design. Your app is compiled into a slug for fast distribution by the dyno manager. The filesystem for the slug is read-only, which means you cannot dynamically write to the filesystem for semi-permanent storage. The following types of behaviors are not supported: Caching pages in the public directory Saving uploaded assets to local disk (e.g. with attachment_fu or paperclip)

Security: How to validate image file uploads?

大憨熊 提交于 2019-12-01 03:14:37
问题 I need to accept image file uploads from the users. How can I check and be 100% sure that I don't get a malicious file or something? Check the mime type? Re-draw the image? Anti-virus? 回答1: Redraw the image, read it up with GD's imagecreatefromXXX() and save it back with imageXXX() This way you can also scale it to more convenient sizes and keep bandwidth consumption in check. To save on computing power, deny upload to files bigger than a certain limit. 5megs or 10megs should be fine, as