Author Topic: Downloading files from server  (Read 26347 times)

prash

  • Newbie
  • *
  • Posts: 11
    • View Profile
Downloading files from server
« on: January 27, 2007, 02:43:34 AM »
We have been trying to use the FileSave patch (the feature to download files from server onto the client machines). The patch immediately and it seems be working.... almost. We tried file.OpenSave and the file does get saved on the local machine. There are just two concerns, though:
1. File is Empty (0B)
2. ".txt" is automatically appended to the name.

Any ideas as to what might be going on? Any pointers to a code snippet that might suggest the best way to use the patch. FYI, at the server end, we are saving the file in WebCream's temp directory.

An integral feature of our product depends on saving files locally and this patch seems to be so cool and right on target. Just waiting to understand is properly and use it successfully ;D.

Thank You!

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Downloading files from server
« Reply #1 on: January 27, 2007, 12:38:12 PM »
Have you read http://www.creamtec.com/webcream/doc/faq.html#fileChooser_save FAQ on JFileChooser save? It describes the algorithm used by WebCream to determine the name of the file and sample code that should work. Is your event handling code similar to the sample code? If not, can you post it here so we can try to reproduce the problem?

Also, it would help if you add tracing to your event handling code that does the save and see if you are actually writing into the file. The file size can only be 0 if your application didn't write anything into it.

Just as a sanity check, you can try running WebCream demo's Fixed Dialog. Type in some text into the address text field and then click Export. The download file should have your typed text in it if the product is working correctly.

We have been trying to use the FileSave patch (the feature to download files from server onto the client machines). The patch immediately and it seems be working.... almost. We tried file.OpenSave and the file does get saved on the local machine. There are just two concerns, though:
1. File is Empty (0B)
2. ".txt" is automatically appended to the name.

Any ideas as to what might be going on? Any pointers to a code snippet that might suggest the best way to use the patch. FYI, at the server end, we are saving the file in WebCream's temp directory.

An integral feature of our product depends on saving files locally and this patch seems to be so cool and right on target. Just waiting to understand is properly and use it successfully ;D.

Thank You!


prash

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Downloading files from server
« Reply #2 on: June 14, 2007, 01:33:27 PM »
Brilliant!! Import and Export functionality in "WebCream demo's Fixed Dialog" is exactly what we need to do for reading and writing files. It took me really long time to figure out what part of your demo you were referring to  ;D

You have some really interesting examples here (tree is another one) and having access to the code for demo available on the link: http://creamtec.dynalias.com/webcream/apps/FancyThemeDemo will be be very helpful. Is this source code available as a part of WebCream download?

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Downloading files from server
« Reply #3 on: June 14, 2007, 02:00:43 PM »
No, but we'll make it a part of it. In the meantime, you can view the files attached to this message.

prash

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Downloading files from server
« Reply #4 on: June 15, 2007, 01:29:29 PM »
Thankyou!