upload

Upload files with Ajax and Jquery

无人久伴 提交于 2020-01-04 15:16:05
问题 I've been trying to figure out how to upload a file through ajax for the past several hours and nothing. Here's the code: HTML: <form action="" method="post" id="uploadForm" enctype="multipart/form-data"> <input type="file" name="image" id="image"> <input type="submit"> </form> JS: <script> jQuery(document).ready(function(){ jQuery('form#uploadForm').on('submit', function(e){ e.preventDefault(); var file = jQuery('#image')[0].files[0]; var form_data = new FormData( jQuery("form#uploadForm")[0

Drag and Drop files into a SharePoint webpart to upload into DocLibrary

旧街凉风 提交于 2020-01-04 05:44:29
问题 Is it possible to create a SharePoint (wss3 or MOSS 2007) webpart, to allow files to be dragged and dropped onto it, which would then upload the files into a predefined document library ? I imagine that this would require some form of client side scripting (Ajax ?), but my knowledge in ajax is a bit sketchy. From my exploration so far, I'm thinking: User drags file onto 'drop zone' Webpart. This action triggers some code This code Loads the file into a SharePoint library (like this :

Why does this basic imagejpeg() resizer returns a black image?

白昼怎懂夜的黑 提交于 2020-01-04 04:07:04
问题 EDIT Thanks for all your answers, especially @Mailerdaimon who noticed that I wasn't using the computed values in the imagecopyresampled function. I don't get black images anymore, but i still do get some black part so i figure my ratio formula should be updated : if i upload a landscape image, the height of the new image is smaller than 170px, and then there's some black showing. How can i make sure the height of the image goes all the way ? Below is a simple script to allow users upload

How to limit the max “total” file size in dropzone.js?

纵饮孤独 提交于 2020-01-04 02:04:07
问题 Currently I use dropzone to handle the file upload in Jquery. So far it works fine. The only problem is that, in the configuration there is a maxFileSize options , it limit the "single" file size. And as the server (php.ini) also has a "total" file size limitation, I wonder how to limit that in the dropzone.js? Thanks a lot. http://www.dropzonejs.com/#configuration-options 回答1: I only see maxfilesize , paralleluploads and maxfiles I think you may need to keep track of the file sizes as they

What are the caveats with increasing max_post_size and upload_max_filesize?

怎甘沉沦 提交于 2020-01-03 17:24:06
问题 I want to increase max_post_size and upload_max_filesize on my server so that my application will handle larger files (as large as 2gb). But before I do that, what are the caveats? Obviously there was a reason the PHP developers set the size to be low. Will I need a certain amount of RAM for the operation? Any insight would be helpful. 回答1: One of the biggest issues I see, is that POSTS are a one shot deal. What I mean by that is that if your client is uploading a very large file, and a

WordPress 3.0 custom post type with upload

大憨熊 提交于 2020-01-03 15:37:31
问题 Is there a way to insert one (or more) upload field on a custom post type edition page? I don't want to use the midia gallery with all the fields and stuff. 回答1: This is a fairly basic example, but it should get you on your way; function my_upload_field() { echo '<input type="file" name="my_upload_field" />'; } add_action('init', create_function('', 'add_meta_box("my_upload_field", "Upload File", "my_upload_field", "post");')); function handle_upload_field($post_ID, $post) { if (!empty($

WordPress 3.0 custom post type with upload

荒凉一梦 提交于 2020-01-03 15:37:01
问题 Is there a way to insert one (or more) upload field on a custom post type edition page? I don't want to use the midia gallery with all the fields and stuff. 回答1: This is a fairly basic example, but it should get you on your way; function my_upload_field() { echo '<input type="file" name="my_upload_field" />'; } add_action('init', create_function('', 'add_meta_box("my_upload_field", "Upload File", "my_upload_field", "post");')); function handle_upload_field($post_ID, $post) { if (!empty($

Progress Bar in Google Drive Upload

匆匆过客 提交于 2020-01-03 10:02:51
问题 Is there any way to create a progress bar for uploads to Google Drive?. I'm using the Google Drive SDK for Javascript. I can not find anything at all in their documentation. Really appreciate it a little help. 回答1: I have consulted many codes, practically all I've found on Google during these weeks, but none show me the solution. The last thing I've tried is webkitSlice, but really it seems a little crazy to implement that solution. I've tried and Google Drive I returns an error. I find it

SonataAdminBundle file upload: Error

一笑奈何 提交于 2020-01-03 05:53:11
问题 I'm a student actually working on my own Symfony2 project and it's few days now I can't find a solution to my problem. UPDATE: 03.09.2013 I have the current version of symfony and of the sonata admin bundle and need a form in my admin with multiple image uploads. The following code I present is based on this installation documentation: http://sonata-project.org/bundles/admin/master/doc/reference/recipe_file_uploads.html In my case I have an entity Projects (Pf\Bundle\BlogBundle\Entity

PHP Android upload failed

流过昼夜 提交于 2020-01-03 04:58:31
问题 I am currently using hosting24.com for php file upload implementation and going to upload mp4 files. The html file for testing , it workds. When it comes to the execution by Android deivces , it fails and shows the $name = $_FILES["uploaded_file"] is null. Would you please tell me is there any other factors preventing us from successful upload ? The below is my code public String uploadFIle(File file){ String result = ""; HttpURLConnection conn = null; DataOutputStream dos = null; String