How download files with scriptcase.

Hi,
I did a form application where i can upload files to a directory of server. I defined a field with data type Document (File name) and SC creates a button for browse the file and upload it. and, if i try download the file, it works very well too.

Now i need what the end user can download file but it can not edit this field.
Then i create a grid application, i did the same work, but when i tryng download file i get a a message error: File Do Not Exists.

I do not understand why It works well when the application is type form, but do not works for applications type grid.

How can i do it?

Re: How download files with scriptcase.

First of all SC haves (or had) a bug that file names can’t contain spaces or anything else apart from text/numbers.
Then there is bug - if you make the file edition read only, you can’t anymore download the file.
For this I created small JS workaround (add this to grid with files where u want just download possibility enabled):


function sc_form_onload() 
{ 
for(var si = 1; si < 100; si++) {
if (document.getElementById("chk_ajax_img_file" + si) !=null) {
document.getElementById("chk_ajax_img_file" + si).style.display='none';
};
};

for(var si = 1; si < 100; si++) {
if (document.getElementsByName("file" + si).item(0) !=null) {
document.getElementsByName("file" + si).item(0).style.display='none';
}; 
}; 
}

Re: How download files with scriptcase.

Hi alvagar,
I had the similar application works fine for me …

In your grid application, check the document path(as on the server Store Folder)
Grid Application -> Application -> Settings - > Documents Path

Regards
dhana