AE using socket to import picture from URL - Need Your Help

I have a project that works with local network using the path name. I want to update the project to replace all placeholders with a picture located at a URL address instead of the local network. I have no experience with socket coding and can't seem to find the right snippets of code on the internet to get me through this point of using URL as a file location.
I tried this code (using a picture at this URL as an example);
webConnect= new Socket;
if(webConnect.open("http://distilleryimage3.s3.amazonaws.com")) {
         webConnect.write('GET /2940b7e0236511e2af9022000a1f9a23_7.jpg HTTP/1.0nn');
          response=  webConnect.read();
          webConnect.close();
          alert('complete');
} else {
         alert('fail');
Any help will be appreciated. I need the results of the socket connection to be a object I can use in the statement
curItem.replace(new File( <picture path> );
Thanks again.

OK, this comes close to working. I can read the jpg file with QuickTime, though it is corrupted and the image is different color or hue. Nothing else will read the jpg file, it so my efforts to use After Effects have still not been met.
I have not idea why I have to read 1 byte at the beginning of the data set and discard it. I can't find enough information about the jpg header format but it seems there is corruption at the top of the downloaded file. Since I'm downloading the 'contentLength', it's odd that midstream I get corrupted data. It appears to be consistent too.
Anyway, I am about at a lose.
webConnect
= new Socket;
if(webConnect.open( "distilleryimage5.s3.amazonaws.com:80","binary")) {
webConnect.write('GET /distilleryimage5/17bdfa64237411e2a23c22000a1f9d66_7.jpg HTTP/1.0\n\n');
     var file= new File("httpSocket.jpg");
     file.encoding='BINARY'
     file.open ("w","binary");
var contentLength = ""
var statusCode = ""
for (var i = 0; i < 20; i++){
     var response =  webConnect.readln();
     if (new RegExp(/HTTP\/[0-9.]+\s([0-9]+)/).test(response)){
          statusCode = parseInt( new RegExp(/HTTP\/[0-9.]+\s([0-9]+)/).exec(response)[1]);
     else if (new RegExp(/Content-Length: ([0-9]+)/).test(response) ){
          contentLength = parseInt( new RegExp(/Content-Length: ([0-9]+)/).exec(response)[1]);
     else if (new RegExp(/Server: AmazonS3/).test(response) ) {
  break;
if (statusCode != 200) webConnect.close()
else{
alert('statusCode=' + statusCode + ' contentLength=' + contentLength);
    var data = webConnect.read(1);
var data = webConnect.read(contentLength);
file.write(data);
     file.close();
     file.execute();

Similar Messages

  • Using Downloader to Import Pictures from another Hard Drive

    I'm using PSE 5.0 with Windows XP.
    I would like to transfer files from another computer which is connected through our home network. However, I would like to bring the files to the new computer similar to the way downloader does from a camera or memory card.
    The reason is that I want these files to be renamed and to have it automatically create new subfolders based on the date. When I use downloader, it just goes to grab the files, without giving me the option to change file names and add subfolders. Is there anyway I can do this?
    Thanks.
    Jim

    As far as I know, the Get Photos from Files and Folders is designed to make entries in the Elements Catalog but leave the photo files exactly where they currently reside (except for a choice with CD and DVD disc).
    There is an Adobe techdoc that describes moving photo files from hard drive to another but it will not include the automatically create new subfolders based on the date function.
    Since this is a networked disk, I don't know how PSE would treat it. For a USB flash drive, it is possible to do a Get Photos from Camera or Card Reader. (But then a flash drive is similar in many characteristics to a camera card.)
    Does anyone know what would happen in PSE 5 for a Get Photos from Card Reader pointed to a networked drive????

  • Use edit import picture from file to paste .bmp file into diagram

    i am using labview 5.0.1 on a concurrent power MAX. I have a bunch of .bmp files in a separate unix directory. in labview, i open a new VI, choose edit > import picture from file and choose one of the .bmp files but nothing goes to the clipboard.
    what am i doing wrong??

    Import picture from file places it in the clipboard. After importing Edit > Paste to put it on the diagram.

  • I updated my Macbook Pro last week to Lion.  I went to go import pictures from a memory card to my iPhoto, but only a portion of them loaded before my iPhoto froze and I had to Force Quit it. Now iPhoto won't even open... Help!

    I updated my Macbook Pro last week to Lion.  I went to go import pictures from a memory card to my iPhoto, but only a portion of them loaded before my iPhoto froze and I had to Force Quit it. Now iPhoto won't even open... Help!
    Please! I need an answer fast!!!!

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • How do I import pictures from computer files more than one at a time ?

    I recieved the adobe photoshop elements 10 for x mas and no problems with downloading the program but i am having a time importing pictures from my computer files taken from various camaras. the problem is that i can only import pictures from my files 1 at a time. what do i do ? is there a specific tutoral i need to watch ? I know i'm doing something wrong i just don't know, please help Kev

    Welcome to the forum.
    You should be able to use the Shift, or Ctrl modifier keys, to select multiple files, and Import them.
    Now, for Stills, I would strongly suggest that you Scale those Still Images to about the Frame Size of the Project, prior to Import.
    Good luck,
    Hunt

  • How do I get imported pictures (from my macbook pro) onto my iPhone 5?

    How do I get my imported pictures (from my macbook pro) onto my iPhone 5?

    Hey ther Caraaaaa,
    It sounds like you have some photos you have imported to your computer that you would like to sync to your phone. This article should help you navigate to, and configure photo syncing from iTunes to your device:
    iTunes: Syncing photos
    http://support.apple.com/kb/ht4236
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • HT201302 When I am trying to import pictures from my iphone to PC, I get the message'No new pictures of videos were found on this device'. There are lots of pictures which i can see on the iphone. I have a 4S. Is there a way to get around that?

    When I am trying to import pictures from my iphone to PC, I get the message'No new pictures of videos were found on this device'. There are lots of pictures which i can see on the iphone. I have a 4S. Is there a way to get around that?

    It sounds like you are using an application to import. You can do it manually.
    Start > Computer (on the right) > scroll to the bottom and you will see your iPhone under Portable Devices > Open it and you will see a Drive, open that and there will be a DCIM folder. That is where your photos will be (There may be other folders each holding photos).

  • What is the best way to import pictures from iPhoto without compression?

    I'm trying to create a slide show using Final Cut Pro. No, I'm not interested in using iDVD slide show function because it doesn't allow me to do a whole lot. I would like to add titles and music for certain segments with video inserted here and there.
    Anyway, when I used the slide show function in iPhoto, exported it out as a quick movie file, and then imported it into Final Cut Pro, I noticed a significant downgrade in quality of images. It obviously looks different from when I play the slide show in iPhoto. What would be the best way to import pictures into Final Cut Pro without any compression?
    Thanks in advance.

    I only see Share > Export.
    Some versions of iPhoto work that way -it's just Apple moving things around.
    what's the difference between exporting it from iPhoto then import it into FCP vs. just importing directly from FCP?
    Your first post mentioned exporting a slide show from iPhoto -I assumed that is where your images are stored.
    I do not want to import pictures one by one...
    You don't have to. iPhoto will let you select as many as you want, or if the images are elsewhere, you can also select multiple files from FCP's Import dialog.
    ...and stick them together manually.
    Editing is an art and involves some effort on your part. It is not an automated process. This method opens up far more possibilities, access to filters and color correction and the opportunity to use Motion for even more sophisticated animation.
    But, it only allows me to export it as 720 x 480. The original size of my photos is 3872 x 2592. Is there any way I can create a quicktime file in the original size?
    You should be aware that 3872 x 2592 is not a standard pixel aspect ratio that is used in video. The images will be resized to the Sequence settings that you set up in Final Cut Pro.
    I have never used iPhoto to make a slideshow before, but I just gave it a try and was able to export one with the images in their native size, simply by typing the pixel dimensions into the boxes in the dialog window:
    I don't have PhotoMagico myself, but it comes highly recommended by several of the forum regulars.
    Perhaps one of them will see this discussion and help with your last question.

  • HT1229 I cannot import pictures from iPhoto to Powerpoint

    I am unable to import pictures from iPhoto to Powerpoint 2011 :Need hekp; Using Mavericks  and updated Microsoft powerpoint also...
    Need urgent help..
    Thank you

    You do not ever directly access the contents of the iPHoto library - use the media browser - in the lower left of the insert window under media ==> photos ==> iPhoto
    See the user tip on accessing your iPHoto files for more info  --  https://discussions.apple.com/community/ilife/iphoto?view=documents
    LN

  • How can I get imported pictures from my ipad 3 to my laptop?

    Pretty much what the quetions states - "How can I get imported pictures from my ipad 3 to my laptop?"
    I've imported a load of pics from my Nikon D40 to my iPad 3 (ios 6.1) using the iPad camera connector. 
    So far so good.
    However I cannot sync the pictures to my laptop (win 7).  I would like to be able to keep the albums I have created, and get them to the laptop too.
    If a restore was required I might lose thee pics.
    Any advice or apps recommended to help me?
    Thanks in advance,
    Steve Potter

    To copy photos to your computer that were copied to it via the camera connection kit (or taken with it or saved from emails/websites) then see this page (as far as I know you can't copy their albums) - on a PC you can use the windows camera wizard

  • How can I import pictures from aperture into iPhoto

    Since moving to mountain lion OSX, I can't find a way for importing pictures from aperture into iphoto. There used to ba a tab under archive in iPhoto where you could view the aperture library and select pictures to import them into iPhoto. This tab has diappeared. Could anyone tell me how it's done now?

    I noticed indeed that you can change the library under "archive" in iPhoto but when I choose aperture library I can't find the same structure of albums as in aperture.
    Sorry I don't understand this. What is "archive"?

  • Importing pictures from camera roll while maintaining folders

    Hello, I am wondering if there is a way to import pictures from the I have on my iPhone (that are in folders) and put them on my pc while keeing them in those folders?
    Example:
    After having some 2000+ pictures on my iphone, when IOS 5 came out i started putting them in folders...
    I have Folder 1, Folder 2, and Folder 3, etc on my iPhone.
    Is there a way that I can import those folders with their contents onto my pc without importing all the pictures seperately, sorting them, and remaking all the folders?
    Thanks in advance for your help!

    You can use the app PhotoSync to wirelessly transfer the pictures to your computer while maintaining your folder structure.

  • Working alternating with iPhoto and FCE tgrying to import pictures from iPhoto into FCE suddenly all my 22300 pictures disappeared leaving empty frames. Does somebody know where the pictures could have gone and how can I get them back into iPhoto? Lothar

    Working alternating with iPhoto and FCE tgrying to import pictures from iPhoto into FCE suddenly all my 22300 pictures disappeared leaving empty frames. Does somebody know where the pictures could have gone and how can I get them back into iPhoto? Lothar

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • I installed Snow Leopard and now I can't import pictures from iphone or memory chip.

    I installed Snow Leopard to my Mac Book Pro and when I went to import pictures from my Iphone 4 to the Mac I received a message that it could not read the files.  I also tried importing pictures from my camera's memory card and got the same error.  This hadn't happened before the installation of Snow Leopard, what could it be?

    update SnowLeopard to its latest version, v 10.6.8, and alongside that also your iTunes to v10.5
    Use disk utility to repair the OS permissions after all updates are in place.

  • Incorrect file name when importing pictures from camera

    I am using PE 10 on Mac Snow Leopard.
    When I import pictures from my camera and select "Rename Files" with "Custom Date" + "Shot Date" (any format), the file name includes the custom name correctly, but the date part of the file name is some random date (with a weird year: 1913, 1969). Note the example shown on the Photo Downloader is usually the one used. The shot date in the meta data is usually correct. This appears to be similar to a problem when using the "Create Subfolder" option.
    Any ideas why or a work-around?
    I was using PE 8 and did not have this problem.

    Hi dannrendon2,
    Have you successfully run the PSE10_Hot.dmg file? You will not see any change in PSE10 or PhotoDownloader , it is just for fixing the issue of incorrect date format .
    Please follow all the steps mentioned in KB article link mentioned above. Finally when you installed the updater there would be a message of successful installation .
    If there is a failure in your updating process [In your case it is second attempt of updation, there may be a failure] , uninstall your application , check if there is any residual file in application folder under Elements Organizer or Photoshop Elements (delete them). Now again install PSE10 and try to update PSE10_HotFix.dmg updater. There should be a successfully completed message.
    Thanks,
    Nizam

Maybe you are looking for

  • über problems with Z10 for past two weeks.

    Hi there For the past two weeks I've been having major problems with my Z10. I started noticing that my Whatsapp messages were coming through, but not making a sound. I reset and set the notification settings again, but still no luck. I figured since

  • Unable to open PDF files from website

    hi friends, I am using iPad Air and iOS 7.1.2. When I tried to open PDF files from below site in safari, http://www.iar.com/Products/IAR-visualSTATE/User-guides/ ftp://ftp.iar.se/WWWfiles/vs/QuickStartTutorial.pdf it shows error as "Safari can not op

  • Axis options

    I just picked up numbers in a hope of getting completely out of Microsoft's clutches, but there are two things I absolutely have to be able to do in my charts that I can't figure out. 1. Can I reverse the y-axis so the lowest numbers are on top (maki

  • Script format question: Title over

    Question: In the script format when using a "TITLE OVER" is it a General, Shot or an Action format. Appreciate any input here, thanks. Rich

  • JavaFX KeyEvent: a bug or a feature?

    Hello Everyone, please take a look at the following toString()-Representation of KeyEvents. I was expecting '$' as text value, because Shift was pressed. Unfortunately, KeyTyped is not fired in this case, so I am not able to get the information from