Hi everybody.
I've just installed the SVN web client and while i was trying it i found the a strange error when trying to commit a file via web.
A dialogbox pops up, saying that the "filename should be the sabe as the name stored in the server". What's strange is that the file i'm trying to upload, it's just a new version of file stored in the server, with exactly the same name. Is this a bug, or i'm doing something worng?
Thanks in advance for replying,
MAD
Unable to upload file
Re: Unable to upload file
Hi,
Is there anyone with the same problem? I could really use some help here, because we need this functionality on a project that's already on a tight schedule.
MAD
Is there anyone with the same problem? I could really use some help here, because we need this functionality on a project that's already on a tight schedule.
MAD
Re: Unable to upload file
I've the same issue.
Re: Unable to upload file
I guess I found a solution. In the file "include/dialog/fileUpdateContent.jsp" change the existing javascript function by :
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
/*
slashIdx = entered_filename.lastIndexOf('\\');
if(slashIdx == -1) {
slashIdx = entered_filename.lastIndexOf('/');
}
if(slashIdx != -1) {
entered_filename = entered_filename.substring(slashIdx+1, entered_filename.length);
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server');
} else {
return true;
}
} else {
alert('File name must be the same as stored on the server');
}*/
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server (not identical)');
} else {
return true;
}
} else {
alert('File name must be the same as stored on the server (no filename)');
}
return false;
}">
This works fine.
Hope this helps,
David
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
/*
slashIdx = entered_filename.lastIndexOf('\\');
if(slashIdx == -1) {
slashIdx = entered_filename.lastIndexOf('/');
}
if(slashIdx != -1) {
entered_filename = entered_filename.substring(slashIdx+1, entered_filename.length);
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server');
} else {
return true;
}
} else {
alert('File name must be the same as stored on the server');
}*/
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server (not identical)');
} else {
return true;
}
} else {
alert('File name must be the same as stored on the server (no filename)');
}
return false;
}">
This works fine.
Hope this helps,
David
Re: Unable to upload file
One solution that works in IE and Firefox is the following (modify in file "include/dialog/fileUpdateContent.jsp"):
<form name="fileUpdate" method="POST" enctype="multipart/form-data" action="<%=bean.getOkUrl()%>" style="padding:0;margin:0;"
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
slashIdx = entered_filename.lastIndexOf('\\');
if(slashIdx == -1) {
slashIdx = entered_filename.lastIndexOf('/');
}
if(slashIdx != -1) {
entered_filename = entered_filename.substring(slashIdx+1, entered_filename.length);
}
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server');
} else {
return true;
}
/*
} else {
alert('File name must be the same as stored on the server');
}
*/
} else {
alert('File name must be the same as stored on the server');
}
return false;
}">
Thanks,
Nicu
<form name="fileUpdate" method="POST" enctype="multipart/form-data" action="<%=bean.getOkUrl()%>" style="padding:0;margin:0;"
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
slashIdx = entered_filename.lastIndexOf('\\');
if(slashIdx == -1) {
slashIdx = entered_filename.lastIndexOf('/');
}
if(slashIdx != -1) {
entered_filename = entered_filename.substring(slashIdx+1, entered_filename.length);
}
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server');
} else {
return true;
}
/*
} else {
alert('File name must be the same as stored on the server');
}
*/
} else {
alert('File name must be the same as stored on the server');
}
return false;
}">
Thanks,
Nicu
-
- Posts: 1
- Joined: Mon Oct 25, 2010 5:36 pm
Re: Unable to upload file
Unfortunately, the above solutions only remove the filename checking.
The root cause of this problem is that the script doesn't need '\\' when indicating a single backslash
In file "webapps/svnwebclient/include/dialog/fileUpdateContent.jsp"
Find this code:
Now change this:
Into this:
The error is caused by the script mistakenly looking for double backslashes in filenames, while it should be looking for single backslashes.
Thus it cannot extract the filename of your file from the path provided, and can't compare the filename to the one on the server. Resulting in the error.
(Appearently, in javascript, you don't need a double backslash to indicate a single one, if you're putting it in single quotes)
The root cause of this problem is that the script doesn't need '\\' when indicating a single backslash
In file "webapps/svnwebclient/include/dialog/fileUpdateContent.jsp"
Find this code:
Code: Select all
<jsp:useBean id="bean" scope="request" type="org.polarion.svnwebclient.web.controller.file.FileUpdateBean"/>
<form name="fileUpdate" method="POST" enctype="multipart/form-data" action="<%=bean.getOkUrl()%>" style="paddi$
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
slashIdx = entered_filename.lastIndexOf('\\');
if(slashIdx == -1) {
slashIdx = entered_filename.lastIndexOf('/');
}
if(slashIdx != -1) {
entered_filename = entered_filename.substring(slashIdx+1, entered_filename.length);
if (entered_filename != document.getElementById('originalname').value) {
alert('File name must be the same as stored on the server');
} else {
return true;
}
} else {
alert('File name must be the same as stored on the server');
}
} else {
alert('File name must be the same as stored on the server');
}
return false;
}">
Now change this:
Code: Select all
......
<form name="fileUpdate" method="POST" enctype="multipart/form-data" action="<%=bean.getOkUrl()%>" style="paddi$
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
slashIdx = entered_filename.lastIndexOf('\\');
.......
Into this:
Code: Select all
......
<form name="fileUpdate" method="POST" enctype="multipart/form-data" action="<%=bean.getOkUrl()%>" style="paddi$
onSubmit="javascript:{
entered_filename = document.getElementById('filepath').value;
if (entered_filename.length>0) {
slashIdx = entered_filename.lastIndexOf('\');
.......
The error is caused by the script mistakenly looking for double backslashes in filenames, while it should be looking for single backslashes.
Thus it cannot extract the filename of your file from the path provided, and can't compare the filename to the one on the server. Resulting in the error.
(Appearently, in javascript, you don't need a double backslash to indicate a single one, if you're putting it in single quotes)
Re: Unable to upload file
SVN Importer appears to ignore PVCS VM Promotion Groups which we specifically use to track environment snapshots. In all other respects our quite large VM archives are imported successfully but we really need the promotion group info, any ideas?
Lily lara
Re: Unable to upload file
mad10341 wrote:Hi,
Is there anyone with the same problem? I could really use some help here, because we need this functionality on a project that's already on a tight schedule.
MAD
Same problem Here...
Return to “Polarion SVN Web Client”
Who is online
Users browsing this forum: No registered users and 2 guests