Image upload from HTML5 and Javascript

I have been struggling with this since a week. 
No tutorial on the web was able to help me.
Here is what i am trying to do. I am trying to upload an image via HTML5 . I am confused on how i should send the image as. Should i send it directly the response from HTML5 File reader API or i should convert it to a blob and send it? I am able to upload
text data. But when i upload image data. They won't turn up .

You should send the data you read from File API. So in your code above, you should send the data in "requestData" variable. I wrote a blog post some time ago about uploading large files using HTML 5, jQuery and Shared Access Signature which you
may find useful:
http://gauravmantri.com/2013/02/16/uploading-large-files-in-windows-azure-blob-storage-using-shared-access-signature-html-and-javascript/
Relevant code from that blog post:
var reader = new FileReader();
reader.onloadend = function (evt) {
if (evt.target.readyState == FileReader.DONE) { // DONE == 2
var uri = submitUri + '&comp=block&blockid=' + blockIds[blockIds.length - 1];
var requestData = new Uint8Array(evt.target.result);
$.ajax({
url: uri,
type: "PUT",
data: requestData,
processData: false,
beforeSend: function(xhr) {
xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob');
xhr.setRequestHeader('Content-Length', requestData.length);
success: function (data, status) {
console.log(data);
console.log(status);
bytesUploaded += requestData.length;
var percentComplete = ((parseFloat(bytesUploaded) / parseFloat(selectedFile.size)) * 100).toFixed(2);
$("#fileUploadProgress").text(percentComplete + " %");
uploadFileInBlocks();
error: function(xhr, desc, err) {
console.log(desc);
console.log(err);
Hope this helps.

Similar Messages

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • How Do I upload from Lightroom and Bridge to the Creative Cloud

    How Do I upload from Lightroom and Bridge to the Creative Cloud?

    Adobe is still failing on this very important issue!
    They said that their Creative Cloud Connection app would be ready in May/June, and here we are in October!
    I wish Adobe would learn to not release products that are not ready to be used, my 20GB are useless to me unbtil they do something that integrates Br, Lr, Id & Ps specifically with the cloud. I really think that we should start charging interest for the money that we have been loaning Adobe for their developement process.

  • [svn:fx-trunk] 11376: Remove external image support from BitmapImage and BitmapFill.

    Revision: 11376
    Author:   [email protected]
    Date:     2009-11-02 11:39:44 -0800 (Mon, 02 Nov 2009)
    Log Message:
    Remove external image support from BitmapImage and BitmapFill.
    QE notes: none
    Doc notes: ASDoc updated. Any other docs that mention loading external images in BitmapImage, BitmapFill, or Border need to be updated.
    Bugs: none
    Reviewer: Jason
    Tests run: checkintests, cyclone
    Is noteworthy for integration: Yes
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Border.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as

    That PKGBUILD doesn't work, primarily because _svnmod is not set correctly.  The remaining problems are mostly down to not being in the $srcdir directory when checking out the ImageMagick source.  It's also good practice to copy the source and do the build in the copy.  That way, it will be possible to successfully update the source and rebuild the package at a later date.  Otherwise, the PKGBUILD certainly works with the following modifications but I've no idea whether the package is viable because I didn't try installing and testing it.
    _svntrunk=https://www.imagemagick.org/subversion/ImageMagick/trunk
    _svnmod=ImageMagick
    build() {
    cd ${srcdir}
    if [ -d $_svnmod/.svn ]; then
    cd $_svnmod
    svn up
    else
    svn co $_svntrunk $_svnmod
    fi
    rm -r ${srcdir}/${_svnmod}-build
    cp -r ${srcdir}/${_svnmod} ${srcdir}/${_svnmod}-build
    cd ${srcdir}/${_svnmod}-build
    if [ "${CARCH}" = "x86_64" ]; then
    patch -Np1 < ../libpng_mmx_patch_x86_64.patch || return 1
    fi
    Etc., etc.
    Last edited by azleifel (2010-04-11 22:15:09)

  • Adobe Forms in ABAP Image upload from a local drive

    Hello,
    Can anybody suggest me the procedure, how to upload the image field dynamically of an employee which is existing in PA30 to SAP interactive forms (SFP). I have gone through many forums but could not able to find any right solution on it.. and hence my development is required to design the layout and call this not through WDP but using ABAP report SE38 in order to generate the employee CV, the programming logic completed till downlaoding the employee photo to local drive from PA30 and I need the same to upload the picture which is downloaded earlier by my driver program into adobe form. Can anyboby help me on this mentioned issue will be appreciated.
    Thanks in advance.
    Regards,
    Murali.

    Thanks Kittu for your speedy response, I have already checked the link which was sent by you...But I couldn't able to find any helpful solution to my requirement. Can you please suggest me any new procedure to solve my problem.

  • Uploading from PC and Deleting

    I am a new user. When I upload from my PC the artist, album title and song titles are not uploading. I have to load them manually. What am I doing wrong?
    Secondly, if there are tracks I do not like on an album can I delete them, and if so, how?
    Thank you in advance.

    Im also new. have found you have to connect to internet to get details of names etc. do this from the i tunes programe, it says get cd track names. then any you dont want to download to i pod remove the check mark.
    hope this helps

  • Need help regarding image scanning from scanner and resizing it...

    Hi,
    I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!
    Thanks,
    Avinash.
    Edited by: Kalakonda on Jul 24, 2009 8:08 AM

    Kalakonda wrote:
    I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!So what you are doing is you have a Scanner (hardware: like an HP flatbed scanner) attached to a server that you want to use as a scanning station? Is this the senario that you are talking about?

  • Why duplicate images uploaded from iPhoto to Elements?

    Uploading images from iPhoto to PS Elements 13 created duplicates of every image.  I have a MAC with Maverick OS.  Is this a problem for others?  How does one organize in Elements with twice the number of images to handle?  Very frustrating!!

    Thanks for your reply, Barbara B. 
    iPhoto is slated to be discontinued in January 2015.  I didn't mention that because of this, Elements will be my photo organizing software of choice, thus the upload.
    Specifically, the issue I am having is that when uploading my 'unique' images from iPhoto to Elements, Elements duplicated each image, so now I have twice the number of images than were actually in iPhoto.   There is no change in metadata, these are true duplicate images. 
    This seems to be an issue with Elements, and I wondered if anyone else has noticed the same problem? 

  • Image upload from Elements 11 Organizer

    Hi,
    Just wondering if anyone can tell me how to upload images from an album in Elements 11 Organizer to an online print service? I am using a Mac OSX 10.9.2.
    Many thanks,
    Graham

    That's because Folders created in Bridge are folders at the operating system level. The equivalent in Organizer would be Folder you create in the Folder Hierarchy view.
    Organizer Albums are closer in concept to Bridge Collections rather than folders, except in Organizer you don't need to use a search to create the Album.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • Not all images uploading from camera..

    When I upload images from my camera it will load some of them and then it acts like upload is complete.   I have to hit upload several times to get a session uploaded that was shot all at the same time, anyone know what may cause this ?  I didnt realize it did this and it just cost me a session that I have to reshoot now bc I thought all the images were uploaded but they werent.

    Hi Michael sorry for your troubles - a really irritating issue to have!
    This is usually a hardware issue.
    You don't mention how you are downloading images.
    In general most folks would strongly recommend not downloading straight from the camera because of the number of issues that occur.
    If you are using a card-reader then it is likely that it is still a hardware issue.
    It may be the card reader, the USB cable, or the USB controller (rarer but still possible).
    If there is more to this let us know!
    Tony Jay

  • Shortdump on File upload from unix and CX_SY_CONVERSION_CODEPAGE

    Hi,
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was no
    caught in
    procedure "OPEN_INPUT_FILE" "(FORM)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    Characters are always displayed in only a certain codepage. Many
    codepages only define a limited set of characters. If a text from a
    codepage should be converted into another codepage, and if this text
    contains characters that are not defined in one of the two codepages, a
    conversion error occurs.
    Moreover, a conversion error can occur if one of the needed codepages
    '4110' or '4102' is not known to the system.
    Example: µ is creating problems.
    I have a problem in uploading the file with below format
    F091US122580164           PECOSPHERE C18,3µm,33X4.6MM
    1. I am using a custom program to read the file and then updating internal table
    2. Unicode code system
    Please help to resolve this issue.
    Thanks and Regards,
    Raveendra

    Hi Raveendra,
    Similar problem is faced by me in my current project. The solutions I have suggested are as below. I have not received any confirmation as to which solution to be applied.
    To avoid the dump:
    1. Read the file as a NON UNICODE file.
         -- For this we use open dataset statement as OPEN DATASET <name> IN TEXT MODE FOR INPUT ENCODING NON-UNICODE. The file is read as a non-Unicode file. This avoids the dump but it uploads also the non Unicode data in the system. We need to analyse if this will cause any other effect on the system.
    2. Upload file after removing the special characters
         -- We need to upload the file again in the application server after removing the special characters in it.
    3. Bypass the dump by displaying error message
         -- By using OPEN DATASET........IGNORING CONVERSION ERROR, we can suppress the dump. Here the file is not         read but only the dump is suppressed.
    regards,
    Gaurav

  • Are images uploaded from desktop to iPhoto duplicated?

    I just used Migration Assistant to move data from Windows laptop to my new iMac...  The photos that were saved to my desktop were imported into iPhoto.  Does this duplicate the images?  Can I delete the desktop files?
    Relative Newbie to OS X so thanks!

    If you're using iPhoto in the default, managed library mode, then yes.
    Are you running a Managed or a Referenced Library?
    A Managed Library, is the default setting, and iPhoto copies files into the iPhoto Library when Importing. The files are then stored in the Library package
    A Referenced Library is when iPhoto is NOT copying the files into the iPhoto Library when importing because you made a change at iPhoto -> Preferences -> Advanced. (You unchecked the option to copy files into the Library on import) The files are then stored where ever you put them and not in the Library package. In this scenario you are responsible for the File Management.

  • Reinserting Preview/Images missing from  Library and Project

    After ingesting my images from CF reader into a project, I started working on them. For some reason after working on them for awhile, I started noticing that previews were missing from the project. I looked in the Library and they were not there either. However, when I looked in to the project folder (via the Aperture "folder" in Finder), the images and associated Aperture information files were all there in their respective folders.
    I'm not sure how I lost/deleted so many images from my folder and Library (I may have accidently deleted a stack, but when I searched the number of images missing I know I could not have accidently deleted that many that way if I did). But since the files are still on my hard drive in their respective folders, in the right location, is there a way to bring them back into Aperture?
    Thanks,
    Ed

    bump...if anyone can tell me that would be great. I know it sounds like a dumb question, but for the life of me I cannot do any command - import, etc. - that can get these files that reside in the actual folder to show up in Aperture's Library or its original project.
    Thx,
    Ed

  • I just switched from Aperture to Lightroom and PS CC.  My images exported from LR and PS suffer color loss.  Where do I begin to correct this problem?

    I just switched from Aperture to LR and PS CC.  My exported images suffer color loss?  How do I correct the issue?
    I shoot with a Canon 5d Mark III in Adobe 1998 Color Space.  I've been exporting JPEGS for web with Color Space sRGB.

    Does your issue have anything to do with switching from Aperture?
    In other words, if you take a new photograph with your camera, and import it in Lightroom, then export it, is there still a problem?
    Or is the problem somehow tied to transition from Aperture, or photos migrated from Aperture...?
    I'm guessing the reason you brought up Aperture is that you did not have export "color loss" issues in Aperture, like you are having in Lightroom, but since you didn't say... (just want to be sure).
    ~R.

  • IMAGE UPLOAD FROM IP ADDRESS FOLDER

    HAI,
         IN BSP  I AM UPLOADING AN IMAGE FROM A FOLDER WHICH IS PRESENT IN IP ADDRESS ex (
    186.159.20.30\DMS\IMAGE.JPG).I USED THE CODE
    IMG HEIGHT = "130"  SRC = "
    186.159.20.30\dms\IMAGE.jpg". THE CODE IS NOT WORKING. IS THERE ANY CODE TO GET THE IMAGE FROM THE IP ADDRESS FOLDER.
    null

    mh637099 wrote:
    When will we get image albums?
    This is something we are tring to work on, the web team is very busy though so I cannot give you an ETA on this.
     

Maybe you are looking for

  • Mini DisplayPort to VGA Adaptor not Mirroring

    13-inch MacBook Pro (Mid 2012) running 10.8.3 Monoprice Mini DisplayPort to VGA Adaptors freeze the system (no issues with Monoprice Mini DisplayPort to DVI connected to monitor) so I tried an Apple Mini DisplayPort to VGA Adaptor and that works ok,

  • Where to find Adobe Photoshop CS6 Extended?

    Hi, I did download the Adobe Photoshop CS6 trial, via the website I did go to the Download Manager. Now I have it installed, but i'm not sure if I have the extended or normal version. How can I check that? And, if I don't have it.. The download manag

  • Not Ready Agents Receive Internal Cals

    Hi just wondering about something. I have agents logged in but they are not in a READY state. When they are in a NOT READY state they can still receive internal calls from an internal extension. Is there any way to prevent this. Thanks Michael

  • My phone keeps telling me to re connect to iCloud

    My phone will not let me connect to anything and keeps telling me to reconnect to icloud

  • Log a user activity

    Hi. I want, for certain users, to log all activity within my database. I want to know every object they've accessed, every query issued, etc. Anyone know how to do this? I'm running 9i. Thanks KH