<asp:Content ID="Content2" ContentPlaceHolderID="desktop_master_body" runat="server">
<form id="realForm" method="POST" enctype="multipart/form-data">
<div id="dhxForm">
</div>
</form>
<div id="myForm"></div>
<script type="text/javascript">
var lyoMain = new dhtmlXLayoutObject(celDesktop, '1C');
var celMain = lyoMain.cells('a'); //layo
var myForm,
formData;
formData = [{
type: "fieldset",
label: "Uploader",
list: [{
type: "file",
name: "myFiles",
inputWidth: 330,
},
{ type: "button", name: "upload", value: "Upload" }
]
}];
myForm = celMain.attachForm(formData);
myForm.attachEvent("onButtonClick", function(id){
if (id == "upload") {
document.getElementById("realForm").submit();
}
});
</script>
</asp:Content>
This is I upload a file by using a form field “file”. I can get file in the form field and upload. After all action completed, but I cannot know the file upload to where destination ?
I want to ask the upload destination and I can set this path destination ?
Andrei
March 25, 2013, 11:39am
#2
script.php will form target and will parse uploaded file
Script.php is normal file ?
I mean I do not use database . I just use linear a form type “file” . I can use this <script.php> file ?
Andrei
March 25, 2013, 3:56pm
#4
script.php is filename just for example
you need some kind of backend which will parse uploaded file
I know script.php is filename just for example.
I try your code :
But it happen error, and I also attached the error screen to you.
In fact, I just want to know the destination of file after upload ?
And I can set the destination of the upload file ?
Andrei
March 26, 2013, 8:24am
#6
script.php means backend
if you are using java you need to write backend on java, if asp - then you need backend on asp. check our samples dhtmlxForm folder, it have server-side example for asp
Andrei
March 26, 2013, 8:25am
#7
asp backend written for “uploader” but for “file” you also can use it
For old topic , but I have new review.
I use a form and type file field to get the file input. And then I use c# to save as to another directory. In this tech, I will think the and <C#> application skill. In ASP, I use html and c# are ok for upload file and save as file. But I try for and <C#> which has problem. I want to ask the tech for and <C#> application skill.
In - Form get file and submit
{ type: "file", position: "absolute", label: "Terminal", name: "terminal" },
document.forms["frmMainGen"].submit();
In <C#> - Save as target directory
This is sample code :
protected void Page_Load(object sender, EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(clsSQLCommands));
Ajax.Utility.RegisterTypeForAjax(typeof(clsFileCommands));
// Response.Write("<script language='javascript'>alert('testing');</script>");
if (IsPostBack)
{
HttpFileCollection files = Request.Files;
foreach (string fileTagName in files)
{
HttpPostedFile file = Request.Files[fileTagName];
string name = file.FileName;
if (file != null && file.ContentLength > 0)
{
file.SaveAs("C:\\DHTMLX\\" + name);
}
}
}
I want ask you can answer and <C#> application skill ?