AMIT Posted July 22, 2011 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. Quote
Administrators Farshad Mohajeri Posted July 22, 2011 Administrators Posted July 22, 2011 You need to wait until we implement SendFile() method. Quote
imagina Posted July 22, 2011 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. Quote
AMIT Posted July 23, 2011 Author 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. Quote
AMIT Posted July 23, 2011 Author Posted July 23, 2011 You need to wait until we implement SendFile() method. Will it be on the next build? Quote
Administrators Farshad Mohajeri Posted July 23, 2011 Administrators Posted July 23, 2011 Will it be on the next build? Not next build but next version 0.87 will contain it. Quote
dionel1969 Posted July 27, 2011 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). Quote
jlrozano Posted February 17, 2012 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. Quote
Administrators Farshad Mohajeri Posted February 17, 2012 Administrators Posted February 17, 2012 Not next build but next version 0.87 will contain it. Hmmm.. one of the promises we failed to keep! Quote
jlrozano Posted February 17, 2012 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? Quote
Rem Posted March 2, 2012 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? Quote
AMIT Posted March 3, 2012 Author 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.