upload

Photo upload CodeIgniter

允我心安 提交于 2019-12-04 05:50:19
问题 When I upload a photo using CodeIgniter, the name of the image is changed to a random name like "107fb08f4a11cc37a040237cdcf0e48a.jpg" for example. I am having trouble showing the image from the database in the view because it is showing the original upload name and not the new name. How do I disable the function that changes this name? These are the config settings: $config = array( 'upload_path' => './uploads/', 'allowed_types' => 'gif|jpg|png', 'max_size' => '6000', 'max_width' => '2068',

Uploading an Image using AWS SDK for PHP 2

只谈情不闲聊 提交于 2019-12-04 05:32:56
This is driving me crazy -- I have been working on this problem for several days with little success. I've finally hit a brick wall and need help. A lot of the articles and forums that I have searched are not for AWSSDK for PHP 2. We have been using Amazon's S3 to load images through iOS for the past couple of years. Now, I need to implement the upload in a browser. I have downloaded and successfully installed AWSSDK for PHP 2 on our Ubuntu server. I can get connected to our AWS S3 account and display the contents of the buckets. But I am unable to put an image in a bucket. The Exception from

convert byte[] to string when upload a file in asp.net

帅比萌擦擦* 提交于 2019-12-04 05:23:53
问题 I have uploaded a file(image) by asp.net. here is my code: string imgpathpic =Convert .ToString (Session["imgpathpic"]); long sizepic =Convert .ToInt64 (Session["sizepic"]); string extpic = Convert.ToString(Session["extpic"]); byte[] inputpic = new byte[sizepic - 1]; inputpic = FileUpload2.FileBytes; for (int loop1 = 0; loop1 < sizepic; loop1++) { displayStringPic = displayStringPic + inputpic[loop1].ToString(); } I converted byte[] to string by that for,but after line displayStringPic =

How to easily upload files without form submission (with jQuery + AJAX)

拜拜、爱过 提交于 2019-12-04 05:13:09
问题 So I have some form processing code which processes the standard text inputs and also uploaded files (through the $_FILES array) I want to have the submission done through AJAX Will jQuery's post(). method still pass that stuff through -> $_FILES or do I need to do something special? 回答1: Ajax (as defined, using JavaScript) cannot perform file uploads, as JavaScript cannot access the local filesystem. There are workarounds that seem to use Ajax, such as an iframe or using Flash. Hunt around

PHP create folder if it does not exist

夙愿已清 提交于 2019-12-04 03:56:51
问题 I am creating a medium size application. This application consists of a lot of products. Now these products have many images (one product can have 5 - 6 images) To try and make some sort of ordering I want to create one folder for each product this folder contains all images that is bound to the product. Now so far I have tried the following: move_uploaded_file($file, APP.'product_images/'.$product_id.'/'.$image['name']); However when I try this I get the following error: Warning (2): move

Uploadify: Dynamic FormData does not change

江枫思渺然 提交于 2019-12-04 03:54:25
Based on the current uploadify documents, it uses formData (weird all google search results, ppl are using scriptData). The problem is I tried to manually change the formData using setting and onUploadStart event as this uploadify docs said. However the folder always stay the same (/webroot/newsletter) when it reaches the server. It should be (/webroot/newsletter/update), I am testing this way, as the value should be dynamic later on. Any clue what went wrong here? There is another question in the uploadify forum too but no answer so far $('#file_upload').uploadify({ 'method':'POST', 'formData

Can I trust the file type from $_FILES?

自作多情 提交于 2019-12-04 03:47:34
Can I trust the file type from $_FILES when uploading images? Or do I have to check again with exif_imagetype() ? From the documentation : The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted. No you cannot trust the $_FILES['userfile']['type'] variable. The value present in this variable could be forged. You can use finfo_file to detect file type more reliably: $finfo = finfo_open(FILEINFO_MIME_TYPE); // we need mime type echo finfo_file($finfo,

HTML File upload field style

狂风中的少年 提交于 2019-12-04 03:40:06
问题 I am trying to create a file upload field that has a little bit of style to it, but I seem to be having problems finding examples of this. I know part of the reason is that the field itself varies from browser to browser. Any ideas how to do this? Or is there a way to do this without using a file element of a form that can be styled? 回答1: If what you mean is the text field for the file names, you can use the input[type=file] selector in the css files. For example : input[type=file] {

Easy way to do ajax uploading with paperclip in rails?

旧巷老猫 提交于 2019-12-04 03:32:04
I was wondering if there was an easy way e.g. a plugin, to do ajax uploading in rails with paperclip or am I going to have to build it from scratch? Cheers! Edit: Also, I'm looking for a non-flash solution. You can try remotipart ( http://os.alfajango.com/remotipart ). It's a gem fine integrated with Rails 3.1 and 3.0. I have tried it, and all the ajax-file-upload handled like magic. maxiperez I had this problem. Perhaps my solution is your solution Problem paperclip with ajax EDIT: You'll find two versions of ajax upload on https://github.com/apneadiving/Pic-upload---Crop-in-Ajax . Branch

Why Javascript upload chunk sizes change by browser?

。_饼干妹妹 提交于 2019-12-04 03:28:28
问题 I am uploading files by javascript code to server. I noticed that different browsers are sending bytes of different sizes. As you can see in the following pictures, Internet Explorer is sending small bytes but Chrome and Firefox send bigger bytes. I am uploading files with XMLHttpRequest. Can I set standard upload bytes for all browsers? Because different size flow is giving errors on some browsers. Http error is 404.13. I configured web.config file as <requestLimits maxAllowedContentLength=