image-uploading

Yii2 upload field always empty when ajax validation

房东的猫 提交于 2019-12-04 05:30:50
问题 I have problem with upload file. I use kartik-v/yii2-widget-fileinput extension. Here my code: form model rule /** * @inheritdoc */ public function rules() { return [ [['image'], 'required', 'on' => static::SCENARIO_CREATE], [['image'], 'file', 'extensions' => 'png, jpg, jpeg', 'maxSize' => 1024 * 1024], ]; } form view <?php $form = ActiveForm::begin([ 'enableAjaxValidation' => true, 'options' => ['enctype' => 'multipart/form-data'] ]); ?> <?= $form->field($model, 'image')->widget(FileInput:

How to display image from database in CodeIgniter?

会有一股神秘感。 提交于 2019-12-04 04:57:20
I am using CodeIgniter 2.1.0 and MySQL database. I have uploaded an image through a form and successfully stored it in a uploads directory and I have also successfully stored the full path of the image in my database. but i am having problem with showing the image by calling the full path from my database. Here is my code for the upload: $image_path = realpath(APPPATH . '../uploads'); $config = array( 'allowed_types' => 'jpeg|png|gif|jpg', 'upload_path' => $image_path, 'max_size' => 2097152, 'overwrite' => TRUE, 'file_name' => '_' . $i . '_' ); $this -> load -> library('upload', $config); When

Can't upload image from Gallery

白昼怎懂夜的黑 提交于 2019-12-03 21:43:58
I want to let the user either choose a picture from Gallery or take a picture using Camera when clicking on the image view. I followed several tutorials online, and here is my attempt: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.view.View; import

Using asmx file for uploading image from iphone

我的梦境 提交于 2019-12-03 21:32:15
Im struggling here for a lot, Im trying to upload an image from iphone to (iis)server folder using webservice asmx(VB.net) Ive searched a lot and finally used the following code - (IBAction)btnPostImages_Clicked:(id)sender { NSMutableURLRequest *request; request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setHTTPMethod:@"POST"]; [request setURL:[NSURL URLWithString:@"http://192.168.0.2/digita/digitacampus.asmx/SaveImage"]]; NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"]; NSString *contentType = [NSString

html2canvas javascript screenshot and upload

↘锁芯ラ 提交于 2019-12-03 13:27:06
问题 Would it be possible to use html2canvas (This) to take a picture of the user`s screen but also upload the image, get the upload link and send it with ajax to the webserver? if so, how can i do this? 回答1: Yes it is certainly possible to do such a thing. Firstly use the html2canvas api to take a picture of the user's screen: html2canvas(document.body).then(function(canvas) { }); Secondly use the following function to convert the returned canvas image into a base64 encoded URL (defaults to png):

Image upload directive (angularJs and django rest framework)

不打扰是莪最后的温柔 提交于 2019-12-03 12:53:21
问题 I need an image upload directive, here is how my code looks like: # Model class transporter(models.Model): company_name = models.CharField(max_length=100) address = models.CharField(max_length=100) image = models.FileField(upload_to=upload_path,blank=True, null=True) def upload_path(self, filename): return 'photos/%s/%s' % (self.company_name, filename) # Serializer class transporterSerializer (serializers.HyperlinkedModelSerializer): username = serializers.Field(source='username.username')

How do I to insert data into an SQL table using C# as well as implement an upload function?

☆樱花仙子☆ 提交于 2019-12-03 11:34:24
Below is the code I am working with to try to insert data into my 'ArticlesTBL' table. I also want to upload an image file to mt computer. Previously I was working in Visual Studio just with the data controls within my .aspx file to insert data, so trying to do this in C# is new to me. Any help would really be appreciated. Thanks. I am getting an error reading: Incorrect syntax near 'UploadedUserFiles'. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; using System.Data; using System.Data

Error: Validation failed: Images imageable must exist , rails-5.0 , paperclip-5

ぐ巨炮叔叔 提交于 2019-12-03 06:19:59
While i was trying to submit the form, following error occured: Validation failed: Images imageable must exist and render the same new.html.erb view. If i comment the file field in new.html.erb . Product is being created successfully. ProductsController: def new @product = Product.new end def create @product = Product.create!(product_params) if @product.save redirect_to products_path, notice: "Product Created Successfully" else render "new" end end def product_params params.require(:product).permit(:name, :quantity, :price, images_attributes: [:id, :photo, :_destroy]) end new.html.erb: <%=

html2canvas javascript screenshot and upload

耗尽温柔 提交于 2019-12-03 03:26:54
Would it be possible to use html2canvas ( This) to take a picture of the user`s screen but also upload the image, get the upload link and send it with ajax to the webserver? if so, how can i do this? Yes it is certainly possible to do such a thing. Firstly use the html2canvas api to take a picture of the user's screen: html2canvas(document.body).then(function(canvas) { }); Secondly use the following function to convert the returned canvas image into a base64 encoded URL (defaults to png): canvas.toDataURL(); Specification For canvas.toDataURL Now construct a request to send your base64 encoded

Image upload directive (angularJs and django rest framework)

非 Y 不嫁゛ 提交于 2019-12-03 03:07:41
I need an image upload directive, here is how my code looks like: # Model class transporter(models.Model): company_name = models.CharField(max_length=100) address = models.CharField(max_length=100) image = models.FileField(upload_to=upload_path,blank=True, null=True) def upload_path(self, filename): return 'photos/%s/%s' % (self.company_name, filename) # Serializer class transporterSerializer (serializers.HyperlinkedModelSerializer): username = serializers.Field(source='username.username') class Meta: model = transporter fields = ('id','company_name','address','image') it works with only