who has SweetHome3D online source?

This topic has been viewed 14679 times and has 9 replies
Thread status: Active
Questions about Sweet Home 3D installation [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
bluesky5566
Posts: 7
Joined: Wed Jul 28, 2010 6:28 am

who has SweetHome3D online source?

Post by bluesky5566 »

I think sweetHome3d run in my tomcat,and put in my web project,but,i don't know online save and read,please help me !
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: who has SweetHome3D online source?

Post by Puybaret »

Save and read operation depends on how you want to organize user information your server. A default implementation is proposed in source code in PHP.
For more information please read also these subjects:
http://www.sweethome3d.com/support/foru ... hread,1454
http://www.sweethome3d.com/support/foru ... hread,1435
Emmanuel Puybaret, Sweet Home 3D creator
bluesky5566
Posts: 7
Joined: Wed Jul 28, 2010 6:28 am

Re: who has SweetHome3D online source?

Post by bluesky5566 »

thanks a lot,but I can't develop JSP likes PHP,please help me.this is my code.

<%@ page import="org.apache.commons.fileupload.*" pageEncoding="UTF-8"%>
<%@ page import="org.apache.commons.fileupload.servlet.*" %>
<%@ page import="com.scand.fileupload.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*,java.sql.*" %>
<%

String uploadFolder = request.getRealPath("/"+"\\upload");

// Check that we have a file upload request
boolean isMultipart = FileUpload.isMultipartContent(request);

if (!isMultipart) {

out.println ("Use multipart form to upload a file!");

} else {

String fileId = request.getSession().getId().toString();


//创建数据工厂
FileItemFactory factory = new ProgressMonitorFileItemFactory(request, fileId);
ServletFileUpload upload = new ServletFileUpload(factory);

//从请求对象中获得要上传对象
List /* FileItem */ items = upload.parseRequest(request);
String sql = "insert into house_photos (house_id,photo_name) values(?,?)";

//迭代所有上传的FileItem
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();

if (item.isFormField()) {
//如果是表单对象再此处处理
} else {
//处理上传文件
String fileName = item.getName();
int i2 = fileName.lastIndexOf("\\");
if(i2>-1) fileName = fileName.substring(i2+1);
File dirs = new File(uploadFolder);
if(!dirs.exists()){
dirs.mkdir();

}

//dirs.mkdirs();
long l = System.currentTimeMillis();
// String houzhui = fileName.substring(fileName.lastIndexOf("."));

fileName = fileName+l+".sh3d";
if(true){
File uploadedFile = new File(dirs,fileName);
item.write(uploadedFile);
session.setAttribute("FileUpload.Progress."+fileId,"-1");
out.write(1);
System.out.print("1");
out.clear();

}else{
session.setAttribute("FileUpload.Progress."+fileId,"-2");
}

}
}

}
%>

,but it also prompt "can't save home in 'myhome'"!!1
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: who has SweetHome3D online source?

Post by Puybaret »

Code: Select all

out.clear();
should be before:

Code: Select all

out.write(1);
shouldn't it?

Please insert your code between [ code] [ /code] tags.
Emmanuel Puybaret, Sweet Home 3D creator
nicoloconte
Posts: 2
Joined: Wed Sep 22, 2010 12:37 pm

Re: who has SweetHome3D online source?

Post by nicoloconte »

Save and read operation depends on how you want to organize user information your server. A default implementation is proposed in source code in PHP.
For more information please read also these subjects:
http://www.sweethome3d.com/support/foru ... hread,1454
http://www.sweethome3d.com/support/foru ... hread,1435
Hi all, I'm trying to embed SH3D in my Drupal site but I have several problems with the saving and reading functionality. I downloaded listHomes.php and both readHOme.php and writeHome.php but I can't make them work. When I click on the "open" icon the input window show me the source of the listHomes.php file.

Where am I doing wrong?

Thank you very much.
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: who has SweetHome3D online source?

Post by Puybaret »

If I were you, I would learn basics about server scripts and PHP before even trying to deploy these PHP files...
Emmanuel Puybaret, Sweet Home 3D creator
nicoloconte
Posts: 2
Joined: Wed Sep 22, 2010 12:37 pm

Re: who has SweetHome3D online source?

Post by nicoloconte »

I know PHP and Java well, but I need some documentation. Can you help me?
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: who has SweetHome3D online source?

Post by Puybaret »

More and more people ask for help about deploying an online version without even presenting themselves and/or explaining what they want it for.
So yes, I can help but if this deployment is for commercial purpose, don't expect it will be for free.
I guess you'll understand that voluntary work can have some limits...
Emmanuel Puybaret, Sweet Home 3D creator
PixelStudios
Posts: 1
Joined: Tue May 24, 2011 11:39 am

Re: who has SweetHome3D online source?

Post by PixelStudios »

Hi Puybaret

I need to deploy an online version for commercial purpose. Please help us how to further?

Regards
Rajesh
Pixel Studios
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: who has SweetHome3D online source?

Post by Puybaret »

What do you miss in the previous links?
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 0 guests