upload

Automagically Minify CSS and Javascript on Upload

蓝咒 提交于 2019-12-20 19:42:28
问题 Does anyone know of a good way to automatically run certain file types through a processing script on upload? I'm trying to accomplish automatically minifying CSS and Javascript when I upload them to the server, keeping a nice, human-readable version on the local side while keeping a minified one on the server. I'm currently using WinSCP on Windows, which is scriptable to some degree but might not be scriptable enough. I'd probably need some kind of cobbled-together solution, so don't be

jQuery file upload with additional data

假如想象 提交于 2019-12-20 15:29:08
问题 I am using jQuery to do AJAX uploading with additional data. The Stackoverflow code I am following it this one How can I upload files asynchronously? and the code I am using is the following: var formData = new FormData($('form')[0]); $.ajax({ type: "POST", url: "ajax/register.php", dataType: "text", data: { name: $("#name").val(), city: $("#city").val(), image: formData }, success: function(text) { if(text == "data ok pic ok") { window.location = "reg3.php"; } else { errorMessage(text); } },

jQuery file upload with additional data

馋奶兔 提交于 2019-12-20 15:28:10
问题 I am using jQuery to do AJAX uploading with additional data. The Stackoverflow code I am following it this one How can I upload files asynchronously? and the code I am using is the following: var formData = new FormData($('form')[0]); $.ajax({ type: "POST", url: "ajax/register.php", dataType: "text", data: { name: $("#name").val(), city: $("#city").val(), image: formData }, success: function(text) { if(text == "data ok pic ok") { window.location = "reg3.php"; } else { errorMessage(text); } },

Upload Google Cloud Storage iOS

99封情书 提交于 2019-12-20 15:23:32
问题 I'm trying to upload image to Google Cloud Storage for a couple days. I tried to use Google APIs Client Library for Objective-C from this link https://code.google.com/p/google-api-objectivec-client/wiki/Introduction. Here is my code implementation: _serviceStorage = [GTLServiceStorage new]; _serviceStorage.APIKey = API_KEY; _serviceStorage.additionalHTTPHeaders = @{@"x-goog-project-id": PROJECT_ID}; GTLUploadParameters *uploadParam = [GTLUploadParameters uploadParametersWithData:_imageData

Upload Google Cloud Storage iOS

北城余情 提交于 2019-12-20 15:23:15
问题 I'm trying to upload image to Google Cloud Storage for a couple days. I tried to use Google APIs Client Library for Objective-C from this link https://code.google.com/p/google-api-objectivec-client/wiki/Introduction. Here is my code implementation: _serviceStorage = [GTLServiceStorage new]; _serviceStorage.APIKey = API_KEY; _serviceStorage.additionalHTTPHeaders = @{@"x-goog-project-id": PROJECT_ID}; GTLUploadParameters *uploadParam = [GTLUploadParameters uploadParametersWithData:_imageData

Getting a video from S3 and Uploading to YouTube in PHP

ε祈祈猫儿з 提交于 2019-12-20 14:16:19
问题 I have some code working that uploads a video file up to YouTube: $yt = new Zend_Gdata_YouTube($httpClient); // create a new VideoEntry object $myVideoEntry = new Zend_Gdata_YouTube_VideoEntry(); // create a new Zend_Gdata_App_MediaFileSource object $filesource = $yt->newMediaFileSource('file.mov'); $filesource->setContentType('video/quicktime'); // set slug header $filesource->setSlug('file.mov'); I have videos in S3 and I want to upload them to YouTube. The video in our S3 account is public

generate random string in php for file name [duplicate]

孤街浪徒 提交于 2019-12-20 10:48:13
问题 This question already has answers here : PHP: How to generate a random, unique, alphanumeric string? (27 answers) Closed 6 years ago . How would I go about creating a random string of text for use with file names? I am uploading photos and renaming them upon completion. All photos are going to be stored in one directory so their filenames need to be unique. Is there a standard way of doing this? Is there a way to check if the filename already exists before trying to overwrite? This is for a

Uploading a File via SCP with Maven fails

别等时光非礼了梦想. 提交于 2019-12-20 10:39:53
问题 I try to upload an ear created by maven to an application server using scp. When I tried to run mvn wagon:upload-single But I get the following error: [ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload-single (default-cli) on project de.volkswagen.dps.ear: Unable to create a Wagon instance for null: url can not be null -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3

Web2py: How should I display an uploaded image that is stored in a database?

痞子三分冷 提交于 2019-12-20 09:42:06
问题 Is there a web2py way of displaying images from a database table? Example: The model: db.define_table=('images',Field('picture', 'upload' )) The controller: def somefunction(): to get the image. How exactly should I "read" a picture from the database? The view: <img src="{{somefunction}}" /> 回答1: As is, your model will not store the image in the database -- instead, it will store the image on the filesystem, with its new filename stored in the database (in the 'picture' field). If you want to

jQuery upload file using jQuery's ajax method (without plugins)

痴心易碎 提交于 2019-12-20 09:38:02
问题 At moment I want to implement picture upload without using any plug-ins. My upload form looks like this <form action="/Member/UploadPicture" enctype="multipart/form-data" id="uploadform" method="post"> <span> <div class="upload" id="imgUpl"> <h3>Upload profile picture</h3> <div class="clear5"></div> <input type="file" name="file" id="file" /> <button class="btn-bl" id="upComplete"><span>Upload</span></button> </div> </span> </form> And my jQuery code is: $('#upComplete').click(function () { $