Download file remote address to device (storage internal if possible)

Hi all

I tried this for a few hours with different approaches now. Also looking through various forums did get me the result I needed.

Note: I can't use the built-in browser, it must be as lean as possible

First a (the desirable and easiest): don't-> not possible-> survey ClassCastException casting 'connection' return of Connector.open () on a "FileConnection.

FileConnection fc = (FileConnection) Connector.open("http://example.com/files/test.mp4", Connector.READ);

String remoteFileName = fc.getName();

String localFilePath = "file:///store/home/user/" + remoteFileName;
FileConnection fcLocal = (FileConnection) Connector.open(localFilePath, Connector.READ_WRITE);

if(!fcLocal.exists())
{
  fcLocal.create();
  DataOutputStream dos = fc.openDataOutputStream();

  DataBuffer db = new DataBuffer();
  db.write(fis);
  dos.write(db.getArray(),0,db.getArrayLength());
  dos.flush();
  dos.close();
}

Second :-> works for very small files (~ 2 k), but as soon as they are more 'fc.getLength ()' returns a value about 24 (= bytes). I guess that's not the good function to call here, although fc.getHeaderField (HttpHeaders.HEADER_CONTENT_LENGTH); Returns the same value.

HttpConnection fc = (HttpConnection) Connector.open("http://example.com/files/test.mp4", Connector.READ);

/// some stuff here to get the file name out of the url -> remoteFileName

String localFilePath = "file:///store/home/user/" + remoteFileName;FileConnection fcLocal = (FileConnection) Connector.open(localFilePath, Connector.READ_WRITE);

if(!fcLocal.exists()){  fcLocal.create();  DataOutputStream dos = fc.openDataOutputStream();

  DataBuffer db = new DataBuffer();  long fileSize = fc.getLength();

  for (long i = 0; i < fileSize; i++)  {    byte temp = dis.readByte();    db.writeByte(temp);  }

  dos.write(db.getArray(),0,db.getArrayLength());  dos.flush();              dos.close();    }

any suggestions? Maybe I just oversaw some nifty examples that resolves in a few lines.

Thank you

Rob

How - to download large files using the BlackBerry Mobile data system
Article number: DB-00619
http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800431/How_To _...

What is - HTTP 413 request entity too large
Article number: DB-00623
http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Tags: BlackBerry Developers

Similar Questions

  • How to search for text in all of the PDF files on a mobile device?

    How to search for text in all of the PDF files on a mobile device?

    Not possible on mobile devices.

  • How can I delete a file on my iOS device that I downloaded from my iCloud? I just want to keep the Preview on my iOS device without using my storage iOS for the entire file.

    How can I delete a file on my iOS device that I downloaded from my iCloud? I just want to keep the Preview on my iOS device without using my storage iOS for the entire file. This means that the file is still in the iCloud and available to be downloaded to any device.

    In practice, I want to be able to scan and download through my documents located in my iCloud and once I didn't need them on my iOS device I would like 'load their return to the cloud' to my storage of the iOS device is not used.

    Thank you in advance to the community!

    Max

    The only way I found to do that once a file has been downloaded is to remove it and add it again through either from Finder on Mac or iCloud.com.

  • How to recover files deleted from a removable storage device (memory stick)?

    How to recover files deleted from a removable storage device (memory stick)? the only folder to recycle bin is on my network drive, there is none on my memory stick.

    Monday, February 27, 2012, 15:13:17 + 0000, NealAtMOE wrote:

    How to recover files deleted from a removable storage device (memory stick)? the only folder to recycle bin is on my network drive, there is none on my memory stick.

    "Deleting" a file does not actually delete it marks just the space
    also available to be used. There are third-party programs that can
    sometimes recover deleted files. The problem is that the space used by
    the file is likely to be replaced very quickly, and it makes
    the unrecoverable file.

    So your chances of successfully recover this file are decent if you
    Try it again immediately after the deletion of it and go quickly
    downhill from there if you write other files on the device.

    But if the file is large enough, it's still worth a try. Stop
    written on the memory stick immediately, if you did not
    already. Download an undelete program (and here's one:)
    http://www3.TELUS.NET/mikebike/restoration.html but there are several
    others to choose from; Do a search)

    Ken Blake, Microsoft MVP

  • is it possible to download files from cloud storage in my local phone memory

    is it possible to download files from cloud storage in my local phone memory

    Hi zekem29842798,

    I'm sorry, it is not possible to download PDFs of cloud of document to your mobile device. You will need to send the PDF or transfer it via bluetooth/datacable if you want to keep on your local device memory.

    Kind regards

    Nicos

  • I need access to the address book and the internal files path

    I had to update windows, then Thunderbird. I'm trying to restore my address book and such internal records only sent and saved. I have backup, but I can't find the files into it.

    Tried several times but the data must be stored somewhere else.
    Thanks for the interest if. Looks like I have lost.

  • Can not download files with adopted storage

    Anyone else using adopted storage in Marshmallow unable to download files? My SD card works fine, I can move applications to the SD card and application data cache which lives on the SD card also works very well. All my applications are functioning normally, if clearly no problem writing to the SD card.

    However, if I try to download a file - for example to download a file from the application Google Drive, or save an attachment in Gmail - all that would be found in the "Downloads" folder - it just fails. I get an error "unable to write to the storage."

    It cannot be a storage permissions problem, because it happens in any application that attempts to download the folder "Downloads" - and all of the apps I've tried already have granted permission of 'Storage'.

    Any ideas? Thank you!

    Don't worry, it's fixed. A simple reboot fixed it. Although worrying, had been removed a couple of days, I got a notification that says my SD card - even if everything seems to work properly. A restart which sets also.

    I just hope this isn't a sign that I'm developing a problem either with the SD slot on my phone or SD itself card. That's the problem with the aid of stoarge adopted - if the SD card fails, the entire phone actually fails!

    Fingers crossed everything is OK now if...

  • And then visualize it PhoneGap/Cordova download file to the device

    I'm doing a magazine app that downloads images to the device for the magazine can be read when offline or with a bad internet connection.

    I use PhoneGap/Cordova version 3.1 with 10 of BlackBerry and plugins file and file transfer. I made a few changes to my code base that runs on Android and iOS since before he could download files on the Simulator. Ensure the directory that I wanted to save the file to exist and access to the file with the path indicated in fs.root.toURL ().

    But now that I got the files uploaded to the device I can't view. On other platforms, I was able to use theFileEntry.toURL () and set it as the source for an img tag. But for BB10 I see only an empty img tag. =/
    The specified local path is: filesystem:local:///persistent/bblogo.png

    I was searched and seen references to disabling sandbox and by saving the file on blackberry.io.shared or blackberry.io.home, but blackberry is not available for me with PhoneGap 3.1. Looking at the native documentation , that I saw that the shared path is/accounts/1000/shared but trying to browse the file system I am told that the path does not exist. (fs.root.getDirectory ('accounts') to start with).

    I have a GitHub repository with what I'm looking for here: https://github.com/gaqzi/phonegap-bb10-file-transfer-test
    The code in question is here: https://github.com/gaqzi/phonegap-bb10-file-transfer-test/blob/master/www/js/index.js#L38

    I also noticed that the size of the file when the download is complete is much larger than the actual size of the file on my computer. And the same code running on iOS I see not enough to increase the size of the file. I don't know if that has to do any.

    To try to combat the current file size wildly different I coded an image 10 x 10 pixels as Base64, she decoded on the device and saved. Now, he pointed out the same size on my computer and the device, but still can not see. The same exercise done on iOS gives me a visible image.

    For the code on the test of Base64, please see my thread Stack Overflow for this: http://stackoverflow.com/questions/19421245/blackberry-10-cordova-phonegap-3-1-filetransfer-image-do...

    I am at a loss what can I do to access the files I created, anyone has an idea?

    Hello

    The patch for the cordova file api is still ongoing. Until that of land, here is an example for download of an image and inject it into the DOM. It uses XHR, but the filetransfer plugin should work as well.

    https://gist.github.com/jeffheifetz/c1127b4d3e132ffff972

    You will need to 'blackberry.io', which is available as plugin PhoneGap/Cordova here:

    https://github.com/BlackBerry/Cordova-BlackBerry-plugins/tree/master/plugin/com.BlackBerry.IO

    The patch will automatically update toURL so that it returns the full path which has been hard-coded in the example.

  • Select the remote server to download files.

    With the help of CS5.5 I am unable to put files on my test server, except if the remote server is selected. He said: "before using this feature, you must set up a remote server. You want to book one now? ".

    If I check the remote server, I am able to upload files to the test server, also download the remote server that is BAD, I'm just testing and redesigning the site.

    I found another thread saying to remove the site, I did; Nothing helps.

    If I do not select a remote server I'm unable to download and to remodel the site.

    How do you have on this?

    Managed to fix it I made my server under servers model > advanced > server model has been configured for PHP MySQL.

  • I want to include a Download button to download the Zip files from an external server. But each time the address of the server is located in the area of the web. How do I create a download where the address of the file, does not stand in the area of the w

    whenever I try to do a download button, so I can download zip files. the address of the file I'm standing on the addressline.

    But the file I have hosting on another server so I want the address of the file to be exposed.

    How to awoid who.

    Hover over a link will show the path by default, you need to customize this:

    http://StackOverflow.com/questions/9851372/how-can-URL-be-hidden-in-hyperlink-when-mouse-h more

    ink http://StackOverflow.com/questions/6725901/How-do-you-Hide-The-URL-when-you-hover-a-HYPERL

    Thank you

    Sanjit

  • How big a file can I send with track and send? Is there a storage limit, to the extent where the number of files, you can download? How many times you send/download files are purged?

    How big a file can I send with track and send? Is there a storage limit, to the extent where the number of files, you can download? How many times you send/download files are purged?

    Hi pjvconsulting,

    There is no restriction on the number of files that you can send.

    However, for a free & buy account you cannot exceed a limit of 5 GB and 20 GB storage, respectively.

    The size of a file may not exceed 2 GB.

    Kind regards

    Nicos

  • New on dreamweaver... local problem of downloading files on remote site...

    all new to dreamweaver (mx... by the way)... having problems with an ftp connection and downloading the files from the local site to the remote site... all the information appears to be entered correctly in the Manager section of site (local site, remote site... I need test site?) I have no problem to download all the old files Web site in dreamweaver , but then when I go to register a new, it will not download the remote site...
    what I'm really trying to do is to update an existing site, flash slideshow by adding a few new JPEG images and remove some 'old' and then update all image.xml by a new text files to coincide with the new photos in the slideshow. but when I go to save any work that I have done, it will not save and upload them to the remote site.
    any help to solve the problem would be useful...
    Thank you

    Mike

    The error means that DW still think your Checkin/checkout is enabled.

    Follow these steps:

    1 using the site manager, create a NEW site definition that points to the same
    local and remote sites than your original.
    2. to connect to the remote site.
    3. find and DELETE all instances of *.lck at the remote site.

    Now, try to import the file. What is going on?

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    ==================

    'conny b' wrote in message
    News:fndj7u$76t$1@forums. Macromedia.com...
    > I just again tried to put a file, and I got this message...
    > "another user is currently working on this issue (Please enable the check."
    > archiving
    (> outside to avoid overwriting changes made by other users). do you want to
    > Download
    > anyway? »
    > I clicked Yes to...
    > This is a first... had not seen that til just now all of a sudden... im lost
    > like u
    > can tell... :)
    > id be happy to get the answer to the first question of the remote server time and
    > go
    > from there if.
    > Sorry to bother all the time you guys, but I'm just learning the
    > program...
    >

  • all downloaded files are corrupted / custom install

    fresh WinXP install again 500g driveASUS MB A8N - SLI ATHANLON 64 3500 + PROCESSOR amd

    All downloaded files are allegedly corrupt, which means no browser updated (using IE6), no antivirus, nothing.

    No matter what thouhts?

    Set of utilities to test for computer HARDWARE manufacturers:

    Note: If you are OverClocking or use an automatic overclocking or BIOS power saving features, start by disabling: Intel EIST, Turbo Mode, Cool and pretty and fall back to the speed of stock as a starting point.

    Disconnect any other (additional) internal hard drives and external USB devices.
    Look for any loose hard drive power or cables SATA, graphics card or other power cables.

    First run Memtest86 +: 
    It runs from a floppy disk or CD and should eliminate or confirm if your one or more of your memory
    sticks are bad or the values of the SPD in the BIOS are correct.
    Let it run for as long as you can: 2,4,6,8 or several hours (at least 3 full passes), if no errors at that time then your ram is OK.
    http://www.memtest.org/
    Memtest86 + Guide/How To (use the.) ISO to create a bootable CD)
    http://www.overclockers.com/forums/showthread.php?t=409152

    Hard drive test:
    If you do not know your readers of the brand and model, try "Speccy",.
    It provides information from the computer/system in detail:
    OS, CPU, RAM, motherboard, graphics, Hard Drive, optical, Audio, peripherals, network.
    Note: Option RAM indicates number of slots, DRAM Timing.
    Works your memory speed (frequency). The nominal frequency of your memory.
    http://www.Piriform.com/Speccy

    Test your player - create a Bootable CD:
    Ranging from 5 to 20% (depending on the manufacturing) new hard disks are defective.
    Test your drive with the car manufacture utility.
    If you have a new hard drive Seagate the very next thing would be to download Seagate Seatools
    (bootable CD) and check bad sectors:
    http://www.Seagate.com/WW/v/index.jsp?locale=en-us&name=SeaTools&vgnextoid=720bd20cacdec010VgnVCM100000dd04090aRCRD

    For Western Digital readers to download the .iso from WdDiag file: http://support.wdc.com/product/download.asp?groupid=611&sid=30&lang=en

    Samsung Estool: http://www.samsung.com/global/business/hdd/support/utilities/ES_Tool.html
    Samsung Disk Manager software: http://www.samsung.com/Products/HardDiskDrive/utilities/shdiag.htm
    Hitachi Drive Fitness Test Software: http://www.hgst.com/hdd/support/download.htm#DFT
    Diagnostic tool available for use by customers who feel their Toshiba brand Fujitsu hard drive:
    http://SDD.Toshiba.com/main.aspx?path=ServicesandSupport/WarrantySupport/SoftwareUtilities
    Notice of suport Fujitsu disk utility: http://www.fujitsu.com/us/services/computing/storage/hdd/
    Toshiba CD bootable: (BACK Diagnostic Tool version 7.0 for IDE/ATA/SATA hard disks)
    http://SDD.Toshiba.com/main.aspx?path=ServicesSupport/FujitsuDrivesUSandCanada/SoftwareUtilities#diagnostic

    Once Windows is installed:

    Of device drivers: Have you installed latest device from the manufacturer of the motherboard drivers?
    Check their support site for the latest drivers as the CD that came with the computer
    or motherboard may be older and less stable drivers.

    Visit the download of the manufacture of the graphics card:
    Download and install the most recent Windows 7 or 8 drivers for your card.
    ATI: http://support.amd.com/us/gpudownload/Pages/index.aspx
    NVIDIA: http://www.nvidia.com/Download/index5.aspx?lang=en-us

    See also the test of 'Smoke box' Nvidia or other demos: http://www.nvidia.com/object/cool_stuff.html#/demos
    or equivalent ATI.

    Prime 95:
    http://www.Mersenne.org/freesoft/
    It's a stand alone .exe file contained in an archive .zip.
    Simply choose to run the 'stress test' option for 8 hours or more.
    If your PC can pass this test, your memory and CPU
    are very good (close the housing cover in order to maintain adequate ventilation)

    Core Temp:
    The temperature of each core of the processor.
    Note: For the overclockers using stock radiator and cooling fan Intel/AMD you can expect
    a range of 35 to 40 at idle and 60 to 65 C max temperature when running Prime95.
    http://www.alcpu.com/CoreTemp/

    CPU ID (CPUZ): http://www.CPUID.com/cpuz.php
    Watch the clock speed of the CPU under various conditions of loading
    (when using speed step technology Intel EIST).
    #1 Note:
    CPU - ID has two tabs - tab 'Memory' that shows the actual speed of the memory
    and the "SPD" tab shows the nominal speeds for each memory location that is filled.
    #2 Note:
    COMPARE the two values, the actual speed of the memory must not exceed the rated speed of your memory.

    CPUID HWMonitor: Hardware program that reads the sensors of health main PC monitoring systems.
    voltages, temperatures, fans speed.
    http://www.CPUID.com/HWMonitor.php

    Test of Stress of FurMark GPU (graphics card):
    http://www.oZone3D.NET/benchmarks/fur/

    Pass marks burn in test: http://www.passmark.com/
    Burnin test, and their test bench at the same time give a good workout from all the major parts of Windows.

    HD Tune:
    Provides information of the car and has an option (tab scan error) to test your drive.
    http://www.hdtune.com/

    SpeedFan:
    Monitors internal temperatures and has a function of analysis health online (SMART tab) for hard disks drive.
    It displays your drives model number and compares your drive with other discs of the same brand and model.
    http://www.almico.com/SpeedFan.php

    GPU - Z:
    A utility light, designed for you give information about your video card and GPU.
    http://www.techpowerup.com/GPUZ/

    PC WIZARD:
    A powerful utility designed especially for detection of hardware, also analyses more.
    He is able to identify a large scale of system components and supports the latest technologies
    and standards.
    http://www.CPUID.com/pcwizard.php

    J W Stuart: http://www.pagestart.com

  • BlackBerry - problem downloading file

    I want to be able to download files via the java app BB

    first attempt:

    I create browserfield to call 'upload.php' and send the file dirrectly from this page, but got the following error message

    [24941.271] VM: + GC (f) w = 11
    [24942.203] VM:-GCt = 119, b = 1, r = 0, g = f, w = 11, m = 0
    [24942.264] VM:QUOT t = 8
    [24942.264] VM: + CR
    [24942.287] VM:-CR t = 3
    [24943.78] type of bridge: 5 PID: 149 Exception loading URL: net.rim.device.internal.bridge.BridgeDatagramTooLa

    RGEException [24943.78]: size of datagram Bridge: 8295740 exceeds the maximum: 1048576
    [24943.78] AM: output net_rim_bb_browser_olympia_proxy (397)
    [24943.78] net_rim_bb_browser_olympia_proxy cleaning (397) process that is started
    [24943.78] type of bridge: 5 PID: 149 cleaning process Java run
    [24943.787] VM:EVTOv = 7680, w = 201
    [24943.787] type of bridge: 5 PID: 149 disconnection
    [24943.787] type of bridge: 5 PID: 149 uninit
    [24943.797] type of bridge: 7 PID: 149 cleaning process Java run
    [24943.805] type of bridge: 7 PID: 149 disconnection
    [24943.812] type of bridge: 7 PID: 149 uninit
    [24943.812] type of bridge: 5 PID: 149 uninit

     

    second attempt:

    Oh... I thought I can solved this problem by creating a loading screen to read data from the file and send it to 'upload.php' as a type string or one he calls binary data may be...

    I followed the instructions in the following thread

    http://supportforums.BlackBerry.com/T5/Java-development/problem-how-to-upload-file-to-server/m-p/186... and... many other thread

    Pro:

    1. I can send text file on the server with the size< 100kb,="" it="" can="" be="" bigger="">

    disadvantages:

    1. only works with "interface = wifi", other type as Boolean deviceside does not work

    2. when I tried to download an image type ' image/jpeg', the compiler returns the following error

    [9852.57] GS (createSurface): promote temporarily the size of the window
    [9852.585] VM:EVTOv = 1, l = 31
    [9852.585] CMM: CreateFileApp (970) No sig 0 x 424252
    [9852.601] VM:EVTOv = 1, l = 31
    [9852.617] VM:EVTOv = 1, l = 31
    [9852.617] BRM:IDL +.
    [9852.625] BRMR +.
    [9852.625] BRM:NMC:393216
    [9852.625] BRM:JFR:92175860
    [9852.671] VM:EVTOv = 1, l = 31
    [9852.687] VM:EVTOv = 1, l = 31
    [9852.703] VM:EVTOv = 1, l = 31
    [9852.75] VM:EVTOv = 1, l = 31
    [9852.75] BRMR -.
    [9852.75] BRM:NMC:393216
    [9852.75] BRM:JFR:92175860
    [9852.75] BRM:IDL -.
    [9852.812] VM:EVTOv = 1, l = 31
    [9853.0] - 1
    [9854.257] VM:RTMSh = 134, o = 0x34101C00, p = net_rim_bb_trust_application_manager
    [9854.257] VMPRMv = 1
    [9854.265] AM: output net_rim_bb_trust_application_manager (388)
    [9854.304] VM:EVTOv = 7680, w = 194
    [9854.312] net_rim_bb_trust_application_manager cleaning (388) process that is started
    [9854.312] net_rim_bb_trust_application_manager cleaning (388) process
    [9864.101] server response: IMG-20130324 - 00241.jpg
    0
    error

    [9866.492] JVM: bklt @9866492: timer
    [9866.492] JVM: bklt [1] @9866492: usrIdle 14, usrTime 30, usrAct 1
    [9866.492] JVM: bklt [1] @9866492: chkIdle currTime 29, 31
    [9866.492] JVM: bklt @9866492: setTimer 16

    then I want to have a dead-end in my way... but what facebook, twitter etc. Use to upload the local file on their server ?

    additions to Split into pieces

  • How to download files in mydomain_server_2

    Hi Experts,

    I have created java with 2 servers cs managed there in the clouds of the pub, at - it a way to download files, example: mydomain_server2.out server managed as not in the same box with the server administrator?

    And how to upload files to the server?

    Best regards

    Hello

    Yes, you can access other servers managed within your Cluster of JCS (not only the one who has the Server Admins exposed with public IP address) and move the files to/from it.

    Here are the high level steps:

    1. Copy your private ssh key to the administrator of the server (use opc user for the virtual computer and copy the key into the opc home folder)
    2. SSH on the administration as opc Server
    3. make sure that the private ssh key privileges are 600 (to avoid permissions errors)
    4. Open your account and browser oracle cloud you internal JCS of instance and while in the "View" tab, identify the host (virtual computer) within the cluster you want to access the search its host name, search for somehting like this "host:jcs101demo-wls-2" being the host name internal built based on the name of your instance of the JCS, wls - + the number of the node in the cluster
    5. now connect to your virtual machine now using the host when identifying the machine name, for example in the above case will be: ssh-i ssh_private_key opc@jcs101demo-wls-2

    So now you should be able to copy everything that you downloaded Admin Server to the managed server to which you have connected.

    In case you need more details, please see the oracle here.

    Hope that helps.

Maybe you are looking for