RE: [mapserver-users] disk space
Hi, Why don’t you write method for deleting png .mapserver will take care about creating an image.I have C# code. The below code will delete all the files form OutputDIR. I hope it helps you. Or At least you can get some idea about your task. Thanks and Regards Venkat. public void Deleteimages() { try { foreach (string f in System.IO.Directory.GetFiles(OutputDir)) { System.IO.File.Delete(f); } } catch (Exception exp) { } } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 4:25 PM To: mapserver Subject: [mapserver-users] disk space Dear all, I have a demo where I'm using mapserver cgi interface. I'm using the browse mode so each time mapserver receive a request, it creates a temporary png on the server filesystem. Do you know how and when i can delete those temporary image since they are used only one time ? An attacker could easily fill all the server HD locking all the system. Thanks Valerio _ Scopri il Blog http://us.rd.yahoo.com/mail/it/taglines/yahoo/ymail/SIG=11djrg460/**http%3A%2F%2Fwww.ymailblogit.com%2Fblog%2F di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] disk space
Thanks for the quick reply, When you run this function? after each requests ? but if so, the client is able to read the image before you delete it ? best regards, Valerio --- Gio 23/10/08, Venkat Rao Tammineni [EMAIL PROTECTED] ha scritto: Da: Venkat Rao Tammineni [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], 'mapserver' mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 13:05 Hi, Why don’t you write method for deleting png .mapserver will take care about creating an image.I have C# code. The below code will delete all the files form OutputDIR. I hope it helps you. Or At least you can get some idea about your task. Thanks and Regards Venkat. public void Deleteimages() { try { foreach (string f in System.IO.Directory.GetFiles(OutputDir)) { System.IO.File.Delete(f); } } catch (Exception exp) { } } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 4:25 PM To: mapserver Subject: [mapserver-users] disk space Dear all, I have a demo where I'm using mapserver cgi interface. I'm using the browse mode so each time mapserver receive a request, it creates a temporary png on the server filesystem. Do you know how and when i can delete those temporary image since they are used only one time ? An attacker could easily fill all the server HD locking all the system. Thanks Valerio Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! Scopri il blog di Yahoo! Mail: Trucchi, novità e scrivi la tua opinione. http://www.ymailblogit.com/blog___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] disk space
Hi, See after click or whatere it is …. OnOPageprerender Image will be creating an image. And after creation image will be deleting.what my project is doing the same.I am giving that code.. below… protected override void OnPreRender(EventArgs e) { LaodMainMap(ibMap); //Load MainMap by } public void LaodMainMap(System.Web.UI.WebControls.ImageButton imgMap) { MapFunction.Deleteimages();//delete Image form temp folder string imageLoc; string imageURL; imageObj imgRef; imgRef = MapFunction.Map.drawQuery(); imageLoc = MapFunction.OutputDir + / + System.DateTime.Now.ToBinary() + . + imgRef.format.extension; imageURL = imageLoc.Substring(imageLoc.IndexOf(MapFunction.OutputDirURL)); imgRef.save(imageLoc, null); ibMap.Width = imgRef.width; ibMap.Height = imgRef.height; ibMap.ImageUrl = imageURL; MapFunction.IsMapInDirectory = false; } This on Page Load //Temp folder for storing legend map and keymap temp files MapFunction = new RoulacGIS.MapFunctionality(this.Page, Server.MapPath(_AppSetting.TempFolder), _ AppSetting.TempFolder); //initialize map control //Load Map try { LoadMap(); } catch (Exception exp) { exp.Message.ToString(); } //this is separate method for accessing mapfile public void LoadMap() { MapFunction.Map = new mapObj(Server.MapPath(MapFile/) + _AppSetting.MapFilePath); } //create map instance I hope this will help you. Thanks and Regards, Venkat. From: valerio vianello [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2008 4:36 PM To: 'mapserver'; Venkat Rao Tammineni Subject: RE: [mapserver-users] disk space Thanks for the quick reply, When you run this function? after each requests ? but if so, the client is able to read the image before you delete it ? best regards, Valerio --- Gio 23/10/08, Venkat Rao Tammineni [EMAIL PROTECTED] ha scritto: Da: Venkat Rao Tammineni [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], 'mapserver' mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 13:05 Hi, Why don’t you write method for deleting png .mapserver will take care about creating an image.I have C# code. The below code will delete all the files form OutputDIR. I hope it helps you. Or At least you can get some idea about your task. Thanks and Regards Venkat. public void Deleteimages() { try { foreach (string f in System.IO.Directory.GetFiles(OutputDir)) { System.IO.File.Delete(f); } } catch (Exception exp) { } } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 4:25 PM To: mapserver Subject: [mapserver-users] disk space Dear all, I have a demo where I'm using mapserver cgi interface. I'm using the browse mode so each time mapserver receive a request, it creates a temporary png on the server filesystem. Do you know how and when i can delete those temporary image since they are used only one time ? An attacker could easily fill all the server HD locking all the system. Thanks Valerio _ Scopri il http://us.rd.yahoo.com/mail/it/taglines/yahoo/ymail/SIG=11djrg460/**http%3A%2F%2Fwww.ymailblogit.com%2Fblog%2F Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! _ Scopri il http://us.rd.yahoo.com/mail/it/taglines/yahoo/ymail/SIG=11djrg460/**http%3A%2F%2Fwww.ymailblogit.com%2Fblog%2F Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] disk space
Sorry but i still not understand... my scenario is client-server , in the server side I have a java servlet as an interface between the client and mapserver. now if i understood i would have to delete the tmp image on the server after the servlet send beck the answer to the client. But How I can be sure that the client download the image before I delete it ? Thanks Valerio --- Gio 23/10/08, Venkat Rao Tammineni [EMAIL PROTECTED] ha scritto: Da: Venkat Rao Tammineni [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], 'mapserver' mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 13:33 Hi, See after click or whatere it is …. OnOPageprerender Image will be creating an image. And after creation image will be deleting.what my project is doing the same.I am giving that code.. below… protected override void OnPreRender(EventArgs e) { LaodMainMap(ibMap); //Load MainMap by } public void LaodMainMap(System.Web.UI.WebControls.ImageButton imgMap) { MapFunction.Deleteimages();//delete Image form temp folder string imageLoc; string imageURL; imageObj imgRef; imgRef = MapFunction.Map.drawQuery(); imageLoc = MapFunction.OutputDir + / + System.DateTime.Now.ToBinary() + . + imgRef.format.extension; imageURL = imageLoc.Substring(imageLoc.IndexOf(MapFunction.OutputDirURL)); imgRef.save(imageLoc, null); ibMap.Width = imgRef.width; ibMap.Height = imgRef.height; ibMap.ImageUrl = imageURL; MapFunction.IsMapInDirectory = false; } This on Page Load //Temp folder for storing legend map and keymap temp files MapFunction = new RoulacGIS.MapFunctionality(this.Page, Server.MapPath(_AppSetting.TempFolder), _ AppSetting.TempFolder); //initialize map control //Load Map try { LoadMap(); } catch (Exception exp) { exp.Message.ToString(); } //this is separate method for accessing mapfile public void LoadMap() { MapFunction.Map = new mapObj(Server.MapPath(MapFile/) + _AppSetting.MapFilePath); } //create map instance I hope this will help you. Thanks and Regards, Venkat. From: valerio vianello [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2008 4:36 PM To: 'mapserver'; Venkat Rao Tammineni Subject: RE: [mapserver-users] disk space Thanks for the quick reply, When you run this function? after each requests ? but if so, the client is able to read the image before you delete it ? best regards, Valerio --- Gio 23/10/08, Venkat Rao Tammineni [EMAIL PROTECTED] ha scritto: Da: Venkat Rao Tammineni [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], 'mapserver' mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 13:05 Hi, Why don’t you write method for deleting png .mapserver will take care about creating an image.I have C# code. The below code will delete all the files form OutputDIR. I hope it helps you. Or At least you can get some idea about your task. Thanks and Regards Venkat. public void Deleteimages() { try { foreach (string f in System.IO.Directory.GetFiles(OutputDir)) { System.IO.File.Delete(f); } } catch (Exception exp) { } } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 4:25 PM To: mapserver Subject: [mapserver-users] disk space Dear all, I have a demo where I'm using mapserver cgi interface. I'm using the browse mode so each time mapserver receive a request, it creates a temporary png on the server filesystem. Do you know how and when i can delete those temporary image since they are used only one time ? An attacker could easily fill all the server HD locking all the system. Thanks Valerio Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! Scopri il blog di Yahoo! Mail: Trucchi, novità e scrivi la tua opinione. http://www.ymailblogit.com/blog___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] disk space
Valerio, I think that most people just set up a cron job or a scheduled job on their server to delete all of the temporary images at some periodic interval. (e.g. 24hrs, 12hrs, 1hr) Your interfval would depend on the number of images that you are generating, disk space, etc. In the code that you use to delete the files, you may want to look at the timestamps on the images and only delete images that are at least 1 minute old, so you don't accidentally delete an image before it can be used by the page that called it. David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 6:06 AM To: 'mapserver'; Venkat Rao Tammineni Subject: RE: [mapserver-users] disk space Thanks for the quick reply, When you run this function? after each requests ? but if so, the client is able to read the image before you delete it ? best regards, Valerio --- Gio 23/10/08, Venkat Rao Tammineni [EMAIL PROTECTED] ha scritto: Da: Venkat Rao Tammineni [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], 'mapserver' mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 13:05 Hi, Why don't you write method for deleting png .mapserver will take care about creating an image.I have C# code. The below code will delete all the files form OutputDIR. I hope it helps you. Or At least you can get some idea about your task. Thanks and Regards Venkat. public void Deleteimages() { try { foreach (string f in System.IO.Directory.GetFiles(OutputDir)) { System.IO.File.Delete(f); } } catch (Exception exp) { } } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 4:25 PM To: mapserver Subject: [mapserver-users] disk space Dear all, I have a demo where I'm using mapserver cgi interface. I'm using the browse mode so each time mapserver receive a request, it creates a temporary png on the server filesystem. Do you know how and when i can delete those temporary image since they are used only one time ? An attacker could easily fill all the server HD locking all the system. Thanks Valerio Scopri il Blog di Yahoo! Mail http://us.rd.yahoo.com/mail/it/taglines/yahoo/ymail/SIG=11djrg460/**http%3A%2F%2Fwww.ymailblogit.com%2Fblog%2F : trucchi, novità, consigli... e scrivi la tua opinione! Scopri il Blog di Yahoo! Mail http://us.rd.yahoo.com/mail/it/taglines/yahoo/ymail/SIG=11djrg460/**http%3A%2F%2Fwww.ymailblogit.com%2Fblog%2F : trucchi, novità, consigli... e scrivi la tua opinione! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] disk space
Thank you very much David... Valerio --- Gio 23/10/08, Fawcett, David [EMAIL PROTECTED] ha scritto: Da: Fawcett, David [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], mapserver mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 15:24 Message Valerio, I think that most people just set up a cron job or a scheduled job on their server to delete all of the temporary images at some periodic interval. (e.g. 24hrs, 12hrs, 1hr) Your interfval would depend on the number of images that you are generating, disk space, etc. In the code that you use to delete the files, you may want to look at the timestamps on the images and only delete images that are at least 1 minute old, so you don't accidentally delete an image before it can be used by the page that called it. David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 6:06 AM To: 'mapserver'; Venkat Rao Tammineni Subject: RE: [mapserver-users] disk space Thanks for the quick reply, When you run this function? after each requests ? but if so, the client is able to read the image before you delete it ? best regards, Valerio --- Gio 23/10/08, Venkat Rao Tammineni [EMAIL PROTECTED] ha scritto: Da: Venkat Rao Tammineni [EMAIL PROTECTED] Oggetto: RE: [mapserver-users] disk space A: [EMAIL PROTECTED], 'mapserver' mapserver-users@lists.osgeo.org Data: Giovedì 23 ottobre 2008, 13:05 #yiv123248558 UNKNOWN { FONT-FAMILY:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} #yiv123248558 UNKNOWN { FONT-FAMILY:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} #yiv123248558 #yiv1232889979 #yiv1232889979 P.MsoNormal { FONT-SIZE:12pt;MARGIN:0in 0in 0pt;FONT-FAMILY:Times New Roman, serif;} #yiv123248558 #yiv1232889979 LI.MsoNormal { FONT-SIZE:12pt;MARGIN:0in 0in 0pt;FONT-FAMILY:Times New Roman, serif;} #yiv123248558 #yiv1232889979 DIV.MsoNormal { FONT-SIZE:12pt;MARGIN:0in 0in 0pt;FONT-FAMILY:Times New Roman, serif;} #yiv123248558 #yiv1232889979 A:link { COLOR:blue;TEXT-DECORATION:underline;} #yiv123248558 #yiv1232889979 SPAN.MsoHyperlink { COLOR:blue;TEXT-DECORATION:underline;} #yiv123248558 #yiv1232889979 A:visited { COLOR:purple;TEXT-DECORATION:underline;} #yiv123248558 #yiv1232889979 SPAN.MsoHyperlinkFollowed { COLOR:purple;TEXT-DECORATION:underline;} #yiv123248558 #yiv1232889979 SPAN.EmailStyle17 { COLOR:#1f497d;FONT-FAMILY:Calibri, sans-serif;} #yiv123248558 #yiv1232889979 .MsoChpDefault { } #yiv123248558 UNKNOWN { MARGIN:1in;} #yiv123248558 #yiv1232889979 DIV.Section1 { } Hi, Why don’t you write method for deleting png .mapserver will take care about creating an image.I have C# code. The below code will delete all the files form OutputDIR. I hope it helps you. Or At least you can get some idea about your task. Thanks and Regards Venkat. public void Deleteimages() { try { foreach (string f in System.IO.Directory.GetFiles(OutputDir)) { System.IO.File.Delete(f); } } catch (Exception exp) { } } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of valerio vianello Sent: Thursday, October 23, 2008 4:25 PM To: mapserver Subject: [mapserver-users] disk space Dear all, I have a demo where I'm using mapserver cgi interface. I'm using the browse mode so each time mapserver receive a request, it creates a temporary png on the server filesystem. Do you know how and when i can delete those temporary image since they are used only one time ? An attacker could easily fill all the server HD locking all the system. Thanks Valerio Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e scrivi la tua opinione! Scopri il blog di Yahoo! Mail: Trucchi, novità e scrivi la tua opinione. http://www.ymailblogit.com/blog___