w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
paperclip with amazon s3 working in development but not working in production (amazon ec2)?
Had same issue with image_magic that was breaking our paperclip functionality in production, but not in development (weird, I know). Yet even after removing imagemagick from our gemfile and Gemfile.lock locally (running bundle install and all that stuff) and then deploying back to production on heroku, the error persisted in production! (weird, I know). What ended up doing the trick was running: $ heroku repo:purge_cache -a myAppName (Taken from: https://github.com/heroku/heroku-repo#purge_cache) When you deploy your app, Heroku caches some things like your assets and installed gems in order to speed up deployment. Although this is a great feature, it can have side-effects sometimes, and in this case, it seems that something about the imagemagick gem got "stuck" in production's cache,

Categories : Ruby On Rails

ASP.NET uploading a file to Amazon S3
You need to assign File or InputStream property of PutObjectRequest object. The code fragment should look like this one: using (client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey)) { var stream = new System.IO.MemoryStream(); originalBMP.Save(stream, ImageFormat.Bmp); stream.Position = 0; PutObjectRequest request = new PutObjectRequest(); request.InputStream = stream; request.BucketName="MyBucket"; request.CannedACL = S3CannedACL.PublicRead; request.Key = "images/" + filename; S3Response response = client.PutObject(request);

Categories : C#

Uploading from Android to Amazon S3
Would you be willing to consider an alternative: class S3 extends AmazonS3Client {final String bucket; S3(String u, String p, String Bucket) {super(new BasicAWSCredentials(u, p)); bucket = Bucket; } boolean put(String k, String v) {try {final ByteArrayInputStream b = new ByteArrayInputStream(v.toString().getBytes()); putObject(bucket, k, b, new ObjectMetadata()); setObjectAcl(bucket, k, CannedAccessControlList.PublicRead); // Has to be here to allow change to reduced redundancy changeObjectStorageClass(bucket, k, StorageClass.ReducedRedundancy); setObjectAcl(bucket, k, CannedAccessControlList.PublicRead); // Has to be repeated beca

Categories : Android

PHP process file before uploading it to amazon s3
When uploading a file to PHP, it will always be saved to disk before your PHP script starts executing (see upload_tmp_dir in php.ini). The closest thing to having an in-memory upload would be to use a ramdisk for that temporary upload location. Instead of uploading the file trough PHP, you could upload it directly to S3 from the client's browser but I don't really see how that would benefit you, since you will need to download it to your server at some point to do the histogram processing.

Categories : PHP

Amazon s3 multipart upload - not uploading
It seems to be working only when the partSize is 5 MB. long partSize = 5242880; I changed it to 4 MB and tried. It was not working. I also changed it to 8 MB and tried. It did not work. Only when the partSize is 5 MB it worked fine.

Categories : Amazon

Image uploading using codeigniter file uploading class
try this one say your input file like <input type="file" name="image" id="image"> now change the following line !$this->upload->do_upload() with !$this->upload->do_upload('image') please let me know if you face any problem. UPDATE if you want to sent it to the template then do like this if (!$this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); $this->session->set_flashdata('msg',$error['error']); redirect('controller_name/function_name','refresh'); } try this and let me know.

Categories : Image

AngularJS and Ruby on Rails - Uploading multiple files directly to Amazon S3
Technically, your javascript residing in the browser could make HTTP RESTful calls to AWS and store data in S3, but then you would be exposing the security credentials to connect to AWS in the script.. not good. I guess the only way is to process it thru a web-server which can securely access AWS and store the notes.. or, you could just write those notes to a local disk (where the webserver sits), and schedule tools like s3cmd to automatically synch them with S3 buckets.

Categories : Angularjs

How preserve and keep timestamp of original modified date for file when uploading to Amazon S3?
This would really be a suggestion for Amazon, I would post to their forums. Alternatively, you could write a simple program in Java which would add a timestamp corresponding to your last modified time to the file. After downloading back from Amazon you could run the app in reverse to retrieve that information. Hope this helps.

Categories : Java

asp.net membership sometmies fails in production
Only thing I can think of will be to add User != null in if statement. if (User != null && User.Identity.IsAuthenticated) { ... RegisteredPractice prac = (from p in db.RegisteredPractices where p.Email == User.Identity.Name select p).FirstOrDefault(); if(prac != null) // Just to be on safe side. { displayName = prac.DentistFirstName + " " + prac.DentistSurname; } ... }

Categories : Asp Net Mvc

A blank in the URI works in production but fails in development
Spaces are usually replaced with %20 for urls. Most web browsers will automatically replace this for you, so this explains why the browser can go to the site. Just use %20 in place of your spaces and you should be all set.

Categories : Ruby

Django compressor fails to compress coffeeScript files in production
It was a not so easy to find coffeeScript problem. In my machine I was using coffeescript v1.4.X and heroku was using v1.6.3. I had a for own in array that v.1.4 allowed(it shouldn't) but v1.6.3 didn't(actually it didn't show the right error but a different one which is a bug shown here). Anyway I solved the problem fixing the coffee file but I still think its a compressor error not to fail in production ignoring errors without giving any clue of what happened.

Categories : Django

Curl command uploading document fails when run from Perl
You should learn to use Perl modules. Perl has some great modules to handle the Web requests. If you depend upon operating system commands, you will end up with not only dependencies upon those commands, but shell interactions and whether or not you need to quote special characters. Perl modules remove a lot of the issues that you can run into. You are no longer dependent upon particular commands or even particular implementation of those commands. (The curl command can vary from system to system, and may not even be on the system you're on). Plus, most of these modules handle the piddling details for you (such as URI escaping strings). LWP is the standard Perl library for implementing these requests. Take a look at the LWP Cookbook. This is a tutorial on the whole HTTP process. Basicall

Categories : Perl

upload multiple files to amazon s3 fails
Here I tried My Project for multi-file Upload with amazon. Its working fine. This is an Example. ////////////////// AWS Code Begin //////////////////// /////////////////////////// Step 1 ///////////////////////////// $ufile = $_FILES['Filedata']; $filename = $ufile['tmp_name']; $filesize = $ufile['size']; /* * ************ Calculating Number of Parts ******************* */ $number_of_parts = 0; $r = $filesize % PART; // Remainder $q = floor($filesize / PART); // Quotient if ($r != 0) { $number_of_parts = $q + 1; } else { $number_of_parts = $q; } $bucket = 'isource123'; $keyname = date("Y") . "/" . date("F") . "/" . date("d") . "/" . $ufile['name']; ///////////////////////////// Step 2 ///////////////////////////// // Create a service builder using a configuration file $a

Categories : PHP

Ruby on Rails omniauth-facebook works in development, but fails in production on Heroku
I'm pretty sure that you've set up your Facebook application to use "localhost" or some development server URL as it's callback. It's failing in production because the URL of your production server is not configured as part of the app. Check the app settings. Edit: I can see a section called "Website with Facebook Login" that has a field called "Site URL". Are you sure you haven't set it to localhost:3000?

Categories : Ruby On Rails

2 MB file upload to AWS S3 fails with Play framework used for uploading multiple files
Am very much pleased with responses I received here [actually none]; I am not sure if none of you geeks knew the issue or infact had any inputs: but anyways, it got resolved and here is the answer: The issue was, in our unix machine, Ngnix was configured and when checked Ngnix error logs, found : [error] 25556#0: *52 client intended to send too large body: which was not allowing even 2 MB files to be uploaded. after changing the configuration to a higher size limit; it started working. below code will help you: Changes in php.ini To change max file upload size to 100MB vim /etc/php5/fpm/php.ini Set… upload_max_filesize = 100M post_max_size = 100M Thanks,

Categories : Scala

Putting multiple objects in Amazon S3 with different meta data fails
You might be confusing the putObject method method with the upload helper method. The upload helper method is available as of version 2.4 of the SDK. Using the upload method you could do the following: try { $sKey = $sBucketFolder . $sFilenameToSave; $obj_FileUpload = $obj_S3->upload($sBucket, $sKey, $sFile, 'public-read', array( 'Metadata' => $arr_ObjectMeta )); $files_uploaded++; } catch (AwsS3ExceptionS3Exception $e) { $files_not_uploaded++; } You can do the same thing with the putObject method as well, it is just slightly more verbose. try { $obj_FileUpload = $obj_S3->putObject(array( 'Bucket' => $sBucket 'Key' => $sBucketFolder . $sFilenameToSave, 'SourceFile' => $sFile, 'ACL' =>

Categories : PHP

PDFTK with PHP exec() fails using Amazon EC2 Windows Server IIS7
The application either needs to be in the same directory as the script, or within the $PATH environment variable for the user executing the PHP script. With IIS, this is not the user you are logged in with.

Categories : PHP

Broken Image link while uploading canvas base64 image to parse.com
I think that you have to user parseFile.url() into the save's promise function. var parseFile = new Parse.File("mypic.jpeg", {base64:imgData}); parseFile.save().then(function(data) { console.log("Got it!"); console.log("Ok"); console.dir(data); console.log(parseFile.url()); }, function(error) { console.log("Error"); console.log(error); } );

Categories : Javascript

Google App Engine channel code fails in production with javascript "Cannot read property 'removeEventListener' of undefined " error
My channel API is working fine. I think I've seen other comments on SO about channels created with version X of an app not working with channels created with version Y, is that what you're running into?

Categories : Javascript

converting image to byte content without uploading image
You can try using the HTML5 : Create a canvas, load your image into it and then use toDataURL() to get the base64 representation. Note: Not tested Edit: http://tutorials.jenkov.com/html5-canvas/todataurl.html

Categories : PHP

Uploading more than one image
Image is also a file. Whether you would be storing it in database / in file system but it is still a file. In spring MVC, you could do as shown in the below link: http://viralpatel.net/blogs/spring-mvc-multiple-file-upload-example/

Categories : Spring

Scrapy image problems on production server
From the docs: The images in the list of the images field will retain the same order of the original image_urls field. If some image failed downloading, an error will be logged and the image won’t be present in the images field. It seems logging must be explicitly enabled, for example like this: from scrapy import log log.msg("This is a warning", level=log.WARNING) So please enable logging, and edit your question to include the error you're getting.

Categories : Python

Codeigniter - image uploading
your upload form shoud include enctype="multipart/form-data" your file input field should named img_fname <img alt="" src="axe.png" 200px; height: 163px;" /> should be <img alt="" src="axe.png" style="200px; height: 163px;" />

Categories : Jquery

Uploading image from Android to GCS
Since no one is answering this question, let me update the way I solved this problem. I ended up following this https://github.com/pliablematter/simple-cloud-storage project. I could upload Pictures/Videos to GCS from my Android app.

Categories : Android

Uploading image onto server
it because you are trying to update the view. may be dialog.dissmiss() is causing it. because you have created it in Main thread i think. and you are dismiss it from background thread. background thread can't update view. so it may be the problem.

Categories : Android

Show image before actually uploading it
You should use FileReader Api and do it... <script> var file=new FileReader(); file.readAsDataUrl(fileInput.files[0]); file.onload=function(evt){ var img=document.getElementById("myimage"); img.src=evt.target.result; } </script>

Categories : Javascript

Image Uploading using bootstrap
Your code in test.php is checking the $_POST variable to see if a file was submitted via the form, but you probably want to be checking $_FILES. Check out the PHP documentation on file uploads for more information. Try changing: if(isset($_POST['image'])) to if(isset($_FILES['image']))

Categories : PHP

Uploading image into a db and folder
If your code is copy/pasted from the actual file, your SQL is using the incorect quote marks in the field list. It should be: $query = " INSERT INTO image_area2 (`id`,`name`,`path`,`unique_id`) VALUES ('','$file_name','uploads/$file_name','$_POST[un_id]'); "; (Notice the back-ticks around id rather than the normal single quote-marks If id is an auto-incremented primary key then change the SQL to: $query = " INSERT INTO image_area2 (`name`,`path`,`unique_id`) VALUES ('$file_name','uploads/$file_name','$_POST[un_id]'); "; Also, a few pointers: Sanitize your variables. $_POST['un_id'] is wide open to SQL injection Move away from the mysql_ functions - they're deprecated. Move to mysqli_ or

Categories : PHP

Rename the image while uploading?
just change this line : move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $your_file_name) and for your image name, you can use md5 of the file and timestamps to create an unique sequence

Categories : PHP

PHP image uploading problems
First of all you should add error handling, see for example the manual. Second, to be able to post a file, you need to add enctype="multipart/form-data" to the form: <form method='POST' action='uploadPic.php' enctype='multipart/form-data'>

Categories : PHP

Issue uploading image
If it is throwing you an error of Problem uploading image than it is probably entering into if condition as your query is failing, you should use mysql_error() to read a friendly message, that what makes your query fail. echo "Problem uploading image.".mysql_error($connection); //Replace connection with the connection var Note: Code is totally dirty, also it uses deprecated mysql_(). So start learning mysqli_() or PDO, also your code is prone to SQL Injections, better sanitize the data and escape the strings before inserting any user provided data in the database Also you are not checking the file extension and the file size which is uploaded by the user, so you must do that too for security reasons and to save huge files uploaded on your server...

Categories : PHP

Uploading multiple image to web API
When you create an instance of HttpPost , you may have just one post change. So that in your for loop you will set new your HttpPost and HttpClient. Create your HttpPost and HttpClient instance in your for loop, then try it again.

Categories : Android

Uploading image directory
When sending variables from PHP to JS use something like this: <button id="add" onclick = "functionName('.$var.')">TEXT</button> function functionName(a) { alert(a); //Just to check }

Categories : PHP

Image and comment uploading
If your image upload is optionally and you want to check if the user has uploaded an image or not you can use the array part $_FILES['image']['error'] this part gives you the errorcode of the file. When this part has the value 4 then no file has been uploade. You can check for that, when moving the file. Src: http://php.net/manual/en/features.file-upload.errors.php I hope this is what you wanted. If not please clarify your question.

Categories : PHP

uploading image in django
Because settings.MEDIA_ROOT is directory. You need to provide filename for handle. Is better to use Model with FileField, because it generates unique file name in media automatically. It is described in https://docs.djangoproject.com/en/1.5/topics/http/file-uploads/

Categories : Python

Cannot get image when uploading to Facebook
The parameter has to be named source, not image, and you have to initialize the PHP SDK with file upload support set to true as well.

Categories : PHP

too much recursion when uploading image
The error 'too much recursion' can be caused by (accidently) including jquery.fileupload.js twice. https://github.com/blueimp/jQuery-File-Upload/issues/2814

Categories : Ajax

Image is not uploading into webservice
These lines are wrong: NSData *image = UIImageJPEGRepresentation([info objectForKey:UIImagePickerControllerOriginalImage], 0.1); NSMutableString *urlString = [[NSMutableString alloc] initWithFormat:@"name=thefile&&filename=recording"]; [urlString appendFormat:@"%@", image]; NSData *postData = [urlString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; ... [urlRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; [urlRequest setHTTPBody:postData]; Replace with: NSData *image = UIImageJPEGRepresentation([info objectForKey:UIImagePickerControllerOriginalImage], 0.1); ... [urlRequest setHTTPBody:image]; Also you should probably change 0.1 to 0.8 or something, or else the quality will be terrible. You will also need to make

Categories : Iphone

Error 400 while uploading image from ios
Try this: // create request NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; [request setHTTPShouldHandleCookies:NO]; [request setTimeoutInterval:30]; [request setHTTPMethod:@"POST"]; // set Content-Type in HTTP header NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; [request setValue:contentType forHTTPHeaderField: @"Content-Type"]; // post body NSMutableData *body = [NSMutableData data]; // add params (all params are strings) for (NSString *param in _params) { [body appendData:[[NSString stringWithFormat:@"--%@ ", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithForm

Categories : IOS

uploading image rails 4
I think you should add "photo" to permitted params, or it will not be put in the model. Then move "photo=" above "private", because if "photo=" is a private method, Rails will not be able to find attribute "photo" def photo=(file_data) unless file_data.blank? @file_data = file_data self.extension = file_data.original_filename.split('.').last.downcase end end private ........

Categories : Ruby On Rails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.