AMIT Posted July 22, 2011 Share Posted July 22, 2011 Please give me some suggestion how to download file that the server just generate after button click. I have a unidbgrid displaying the data that users selected from their desired criteria. I need to have one button for them to download this data after they click on it. This file will be generated at the server after the users click on the button. The file may be Text, XLS or whatever format (this I can do it on the server). After it was generated it should be automatically send back to user by letting them select the folder to store the file (this I need suggestion). Anyway, Thank in advance for any suggestions that may have. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 22, 2011 Administrators Share Posted July 22, 2011 You need to wait until we implement SendFile() method. Link to comment Share on other sites More sharing options...
imagina Posted July 22, 2011 Share Posted July 22, 2011 A workaround working for me (until Farshad implements the SendFile): s := UniServerModule.LocalCachePath + 'imagen'+IntToStr(GetTickCount)+'.bmp'; TBlobField(Qclaus.FieldByName('imatge')).SaveToFile(s); s := Copy(s,Pos('cache',s),255); s := StringReplace(s,'\','/',[rfReplaceAll]); UniLabel12.Caption := '<a href="'+s+'" target=_blank>Descargar imagen</a>'; This example puts a link in a TUniLabel (TextConversion property set to txtHTML). The files saved in the session cache folder are deleted when the session is clossed. Please give me some suggestion how to download file that the server just generate after button click. I have a unidbgrid displaying the data that users selected from their desired criteria. I need to have one button for them to download this data after they click on it. This file will be generated at the server after the users click on the button. The file may be Text, XLS or whatever format (this I can do it on the server). After it was generated it should be automatically send back to user by letting them select the folder to store the file (this I need suggestion). Anyway, Thank in advance for any suggestions that may have. Link to comment Share on other sites More sharing options...
AMIT Posted July 23, 2011 Author Share Posted July 23, 2011 A workaround working for me (until Farshad implements the SendFile): s := UniServerModule.LocalCachePath + 'imagen'+IntToStr(GetTickCount)+'.bmp'; TBlobField(Qclaus.FieldByName('imatge')).SaveToFile(s); s := Copy(s,Pos('cache',s),255); s := StringReplace(s,'\','/',[rfReplaceAll]); UniLabel12.Caption := '<a href="'+s+'" target=_blank>Descargar imagen</a>'; This example puts a link in a TUniLabel (TextConversion property set to txtHTML). The files saved in the session cache folder are deleted when the session is clossed. Thank you for your suggesstion. Link to comment Share on other sites More sharing options...
AMIT Posted July 23, 2011 Author Share Posted July 23, 2011 You need to wait until we implement SendFile() method. Will it be on the next build? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 23, 2011 Administrators Share Posted July 23, 2011 Will it be on the next build? Not next build but next version 0.87 will contain it. Link to comment Share on other sites More sharing options...
dionel1969 Posted July 27, 2011 Share Posted July 27, 2011 Farshad, I know you have a very good great job, but if would be possible to include a thread on the forums where could appear some solutions like this one and others to a variety of problems would be great, as they would be searchable and easily accessible to us, which have less experiences. Of course it would always be with the consent of the authors. It is like a FAQ, but named FAS (S- Solutions). Link to comment Share on other sites More sharing options...
jlrozano Posted February 17, 2012 Share Posted February 17, 2012 Not next build but next version 0.87 will contain it. Hi, At last there is a sendfile() function. I try search it but I don't found. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted February 17, 2012 Administrators Share Posted February 17, 2012 Not next build but next version 0.87 will contain it. Hmmm.. one of the promises we failed to keep! Link to comment Share on other sites More sharing options...
jlrozano Posted February 17, 2012 Share Posted February 17, 2012 Ok, thanks for the quick response. For now, I use the workaround exposed in this thread. Do you plan to implement this function in next release? Link to comment Share on other sites More sharing options...
Rem Posted March 2, 2012 Share Posted March 2, 2012 Just downloaded and compiled with uniGUI Beta v0.88.0.941 (10.8 MB 2012-02-07) Sendfile not active yet? Link to comment Share on other sites More sharing options...
AMIT Posted March 3, 2012 Author Share Posted March 3, 2012 Just downloaded and compiled with uniGUI Beta v0.88.0.941 (10.8 MB 2012-02-07) Sendfile not active yet? He forgot as he said in #9. Anyway I knew he had many thing to do but I still hope he will make it soon. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now