upload

PHP Codeigniter Uploading Class, rename files with specific schema

梦想的初衷 提交于 2019-12-05 22:50:29
I am having a spot of trouble with Codeigniter and getting files to rename within the upload process from the Upload Library it has to offer. Now before anyone says it, I am not looking for "encrypted" file names. My Problem is in uploading images you have a good handful of types you could be dealing with. So how does one change the file name using the file_name config option to a specific schema (which I already have the schema part up and working). But maintain the same file type? Right now I am attempting $upload_config['file_name'] = $generated_filename_from_schema Only problem is

Using Darren Johnstone's Large File Upload Library with ASP.NET MVC Controllers

不羁的心 提交于 2019-12-05 22:48:26
Darren Johnstone wrote a comprehensive server control and library to upload large files with a progress bar in ASP.NET. I would like to use it with ASP.NET MVC, using a controller method to receive the file, and an Ajax controller method to drive the status bar. I have studied the classes, but am having difficulty getting my mind around what the punch-in points are, and how it would be integrated into MVC. Has anyone used this with MVC, withou using the server controls included with the library? If so, how? A simple code sample would be great. NOTE: I am willing to use a different upload

How to monitor file upload progress?

时光毁灭记忆、已成空白 提交于 2019-12-05 22:44:50
I need to upload a file to server and monitor it's progress. i need to get a notification how many bytes are sent each time. For example in case of download i have: HttpURLConnection connection = (HttpURLConnection) m_url.openConnection(); connection.connect(); InputStream stream = connection.getInputStream(); while ((currentBytes = stream.read(byteBuffer)) > 0) { totalBytes+=currentBytes; //calculate something... } Now i need to do the same for upload. but if use OutputStreamWriter stream = new OutputStreamWriter(connection.getOutputStream()); stream.write(str); stream.flush(); than i can't

Uploading images with PHP and hitting the script memory limit

谁说我不能喝 提交于 2019-12-05 21:21:57
I am trying to upload a JPG image using a PHP script, but the image is keeps causing my script to time out and die giving this error: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2136 bytes) in image.php on line 38 How can I prevent the upload from taking place if the image is too big, or have this error fail gracefully? The actual problem is not with the initial file size but with the dimensions of the image itself (height width colorDepth), since you don't have access to this information before the file has been uploaded for security reasons, you should

Storing uploaded images: Should it be stored on the server or in the database?

旧街凉风 提交于 2019-12-05 21:19:47
I've been working on renovating a very old Java Servlet based webapp. The webapp lets users upload images. The webapp stores a path reference to the images in the database, but uploads the images to a directory on the server where they stay. The database for the webapp was upgraded to Oracle 11g which I am told can handle binary information. So, my question is, which is the smarter thing to do? Stay with storing the images as files on the server or stuff the images into the Oracle 11g database? Thanks much in advance Steve Yes, you can use BLOBs for binary data in Oracle. (And many other

Google cloud storage - how to limit size of user uploads?

≯℡__Kan透↙ 提交于 2019-12-05 20:53:59
I'm building a service where users can upload images. I want to prevent users from uploading files bigger than 5mb. Right now I create a 'signed url' for cloud storage user PUT and GET requests. Is there any way I can limit the size of a user upload? I don't want users to start uploading extremely large files by mistake or with malicious intent. Kamran There are three ways to control access to Google Cloud Storage buckets and objects: Access Control Lists (ACLs) , which provide a way to specify read or write access for specified Google accounts and groups. Signed URLs (Query String

Show the image preview before uploading it to the server

淺唱寂寞╮ 提交于 2019-12-05 20:51:44
Hello I am looking for a Javascript or jQuery based solution to show an image preview of the SELECTED image and not of the uploaded one. So as soon as the user selects the image a preview will be shown of this image. I do not have any code, I am pretty lost here. I need a solution HTML + Javascript or jQuery based. I can also use some PHP if necessary To do that, you need to use the HTML5 File API . Almost every latest browsers support this feature except IE9. Safari 5.1 supports this but it's still in beta. You can check the HTML5 File API browser compatibility here . There are good tutorials

Cannot upload app to Chrome Web Store - “This item is not an app, please remove app section from manifest.”

半世苍凉 提交于 2019-12-05 19:39:46
I am constantly getting this error when uploading my app: An error occurred: Failed to process your item. This item is not an app, please remove app section from manifest. This is the manifest file for my Chrome app (based on the Getting started - Hello World tutorial): { "name":"App name", "description":"app description", "version":"1.0.4", "manifest_version":2, "app":{ "background":{ "scripts":["background.js"] } }, "icons":{ "16":"icon_16.png", "18":"icon_128.png" } } I tried to install my application locally through the Chrome extensions section and it works just fine. I can see it

How to upload a file with PHP, curl and HTTP POST by streaming the file?

爷,独闯天下 提交于 2019-12-05 19:06:08
Lets say I have a large file that I want to HTTP POST to a webservice using PHP and curl. The file is larger than the amount of memory I can let PHP use. Basically I'm looking for a way to stream the content of a file directly to curl, without reading the entire file into memory. I have success using multipart POSTs and PUT, but not "binary data" upload with POST. What I want to achieve in PHP is what this command line does: $ curl -X POST -H "Content-Type: image/jpeg" \ --data-binary "@large.jpg" "http://example.com/myservice" Tried a lot of options with curl_setopt, such as INFILE,

How to implement custom image uploader for CKEditor5 in Angular 5?

♀尐吖头ヾ 提交于 2019-12-05 18:59:21
I am looking for an example showing an implementation of custom image uploader for CKEditor 5 using Angular 5. There's no need for the Angular-specific version of that adapter. You can use for example this: https://github.com/pourquoi/ckeditor5-simple-upload or try to integrate it with the CKFinder . Then, all you need to do is to pass the configuration object to the <ckeditor [config]='config'> component. Don't forget to set allowJs: true in your tsconfig.json file to allow bundling local JS files. Alternatively, you can create it on your own. This should be the base skeleton of the upload