Zeus IDE Forum Index Zeus IDE
Use this forum to ask for help, submit a bug report or make a suggestion.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Incorrect FTP URL When Uploading File

 
Post new topic   Reply to topic    Zeus IDE Forum Index -> Reporting a Bug
View previous topic :: View next topic  
Author Message
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Mon Feb 11, 2008 11:34 pm    Post subject: Incorrect FTP URL When Uploading File Reply with quote

Using Zeus 3.96n, I have a workspace called "htdocs" with a project under it also called "htdocs" with three files in the project. Under workspace options, I have defined the options on the FTP tab of Server (ftp://ftp.nars2000.org) with UserID and Password.

BTW, the Local Base directory is actually R:\NARS2000\trunk\htdocs, but when I type that in and click on Apply, Zeus displays the path without the drive letter (i.e., \NARS2000\trunk\htdocs) -- I think it should display everything the user types.

Continuing, under File > FTP > FTP Configuration..., in the FTP Hosts tab List of Defined Hosts there is ftp.nars2000.org with a Server of ftp.nars2000.org, along with UserId, Password, Port (empty), and Protocol of FTP.

With a file from the "htdocs" workspace/project open, when I click on File > FTP > Save As to FTP, the File Save As URL dialog displays a URL Name of ftp://NARS2000/trunk/htdocs/index.ahtml. Note the erroneous domain name. I expected that it would pick up the FTP URL of ftp.nars2000.org from one of the two places in which I typed it.

Is this a bug, expected behavior, or have I missed specifying something?
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Tue Feb 12, 2008 1:06 am    Post subject: Reply with quote

Quote:
Is this a bug, expected behaviour, or have I missed specifying something?

I checked the project/workspace FTP upload feature and it seemed to be working fine, but there does appear to be a bug in the download feature Sad

Here is an example to explain how the FTP upload works. Assume we have a file at this location as seen on the local development server:
Quote:
D:\nars2000\trunk\htdocs\index.ahtml

I create a Zeus htdocs workspace in the same folder:
Quote:
D:\nars2000\trunk\htdocs\

and it looks like this:
Quote:
<!-- Workspace file for the Zeus for Windows editor.-->
<workspace name="htdocs" sorted="Yes">
<mode>Debug</mode>
<active>htdocs</active>
<project name="htdocs">htdocs.zpi</project>
</workspace>

and contains this project file which contains the single index.htmla file:
Quote:
<!-- Project file for the Zeus for Windows editor.-->
<project name="htdocs" sorted="Yes">
<file>index.ahtml</file>
</project>

Now assume the ftp://ftp.nars2000.org/ internet server has some d:\ftp home address which also contains the htdocs folder so we want the index.htmla file to live at this location on the FTP server:
Quote:
d:\ftp\htdocs\index.ahtml

This means the effective Internet address of the file (i.e the d:\ftp home address is not seen from the internet) will be:
Quote:
ftp://ftp.nars2000.org/htdocs/index.ahtml

Now going into the Zeus Workspace FTP panel I enter these details:
Quote:
server: ftp.nars200.org
local base directory: d:\nars2000\trunk\
remote base directory: /

Zeus tells me it thinks the remote file location should be:
Quote:
ftp://ftp.nars200.org/htdocs/index.ahtml

which is exactly what I want Smile

So I apply these numbers and hit the workspace upload feature and sure enough the file is copied from the development server to the required FTP address Wink Think of the local base directory as the directory information that Zeus should ignore and remote base directory as the directory information that Zeus needs to add.

For example I could have got the same result using these values:
Quote:
server: ftp.nars200.org
local base directory: d:\nars2000\trunk\htdocs
remote base directory: /htdocs

So the FTP upload is working and the FTP download will be fixed in the next patch Wink

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Tue Feb 12, 2008 8:24 pm    Post subject: Reply with quote

You didn't mention anything about the missing drive letter, perhaps because I forgot to mention that the drive letter I used (R:) is a SUBST drive. If you use a SUBST drive letter, does Zeus delete the drive letter in the Local Base Directory as it does on my system?
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Tue Feb 12, 2008 10:28 pm    Post subject: Reply with quote

Quote:
You didn't mention anything about the missing drive letter, perhaps because I forgot to mention that the drive letter I used (RSmile is a SUBST drive.

If you repeat the steps shown above with your system what data do you enter at each step and what exactly gets displayed and goes wrong Question

Quote:
If you use a SUBST drive letter, does Zeus delete the drive letter in the Local Base Directory as it does on my system?

I'm not sure what you mean by SUBST Question Is this some sort of FTP configuration thing Question

If the R: is a logical Windows drive then it should not matter that I used a D: drive and you use an R: drive.

To test this I setup a local FTP server (127.0.0.1) with a home directory configured as d:\ftp and for me it worked fine.

I can't tell for sure since I am only going on the information you provide, but if the drive letter goes missing then either the data you entered is not the same as shown above, or some far more strange is going wrong Confused

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Tue Feb 12, 2008 11:35 pm    Post subject: Reply with quote

I entered the details as you asked.

When I use a physical drive letter, the drive letter in the Local Base Directory still disappears. To be sure, the text in the GroupBox labeled "Example of the Local/Remote File mapping" below the GroupBox labeled "Base Directory Details" shows the correct drive letter, but if I re-enter the drive letter (I used C and it points to a valid directory) at the beginning of the Local Base Directory then click Apply, the drive letter (and the following colon) disappears.

SUBST is a command which allows you to define a virtual drive letter. For example, I use SUBST R: C:\D\SOURCE so that references to drive R: point to C:\D\SOURCE. However the problem of the disappearing drive letter occurs on non-SUBSTed drives, so you can ignore that.

BTW, in the second sentence after IMPORTANT:, I think you mean to say "The transfer will fail if either directory specified does not exist."
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Wed Feb 13, 2008 12:08 am    Post subject: Reply with quote

Quote:
When I use a physical drive letter, the drive letter in the Local Base Directory still disappears.

Can you use Alt+Print Screen buttons to capture the FTP screen and attach it to this thread or send it to me as an e-mail attachment Question

For example here is the screen capture of my FTP configuration panel:

Quote:
BTW, in the second sentence after IMPORTANT:, I think you mean to say "The transfer will fail if either directory specified does not exist."


Thanks Wink

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Wed Feb 13, 2008 1:47 am    Post subject: Reply with quote

There's no need to post a picture of what I'm talking about as you have already done that! What you are seeing is exactly what I've been trying to describe!

In the Local Base Directory type (say) D: at the start so that it looks like D:\nars2000\trunk. Now click on Apply and see the D: disappear.

Yikes!
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Wed Feb 13, 2008 2:46 am    Post subject: Reply with quote

Quote:
In the Local Base Directory type (say) D: at the start so that it looks like D:\nars2000\trunk. Now click on Apply and see the D: disappear.

I can not replicate what you are seeing as shown below Confused


I even tried this using an earlier version of Zeus just to make sure it was not a version related issue.

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Wed Feb 13, 2008 3:14 am    Post subject: Reply with quote

Please follow my example closely.

Your left hand (Before) image does not have "D:\nars2000\trunk" in the Local Base Directory. Instead it has "\nars2000\trunk".

Please retry the example exactly as I described.
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Wed Feb 13, 2008 3:35 am    Post subject: Reply with quote

Quote:
Your left hand (Before) image does not have "D:\nars2000\trunk" in the Local Base Directory. Instead it has "\nars2000\trunk".

Ok. I now understand what you mean about a missing D: letter Smile

This is not a bug, because the entry fields on this panel represent directories and are designed to not hold drive information.

As I said earlier, the Local Base Directory represent the portion of the directory that will be removed from each and every file contain in the project/workspace.

Adding a drive letter is irrelevant since the files actual drive location has already fully determined by their fully qualified path details as stored in the project itself. For example if a file in the project lives on e: then adding anything but e: to this entry field would make no sense at all.

Since the user has no choice but to enter e: there is really no point in letting the user enter any drive details in the first place and this is exactly what Zeus is doing by stripping away the drive details for this field Wink

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Wed Feb 13, 2008 5:03 pm    Post subject: Reply with quote

Thanks for the explanation -- I now understand what you are trying to do.

However, what happens if the file being edited is D:\example\foo.html and the user enters D:\whatever\ as the LBD. The LBD has no common root to delete from the file's path, so I don't see how it can be interpreted. Moreover the "will map to the following remote file:" displayed upon clicking Apply is quite messed up.

It seems to me that the LBD must completely match some leading part of the file's path, not just the drive letter. Then the trailing part of the file's path (after the LBD has been removed from the leading part) is appended to the end of the Remote Base Directory to obtain the remote path on the Server.
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Wed Feb 13, 2008 10:43 pm    Post subject: Reply with quote

Quote:
However, what happens if the file being edited is D:\example\foo.html and the user enters D:\whatever\ as the LBD. The LBD has no common root to delete from the file's path, so I don't see how it can be interpreted.

This will not be a valid input which is why the upload example does not change for this case:
Quote:
This example local file:

d:\nars2000\trunk\htdocs\index.ahtml

will map to the following remote file:

ftp://ftp.nars2000.org/nars2000?trunk/htdocs/index.ahtml

This is really a case of user input error so I think Zeus should check for it on Apply and display a warning or error message Idea

Quote:
It seems to me that the LBD must completely match some leading part of the file's path, not just the drive letter.

Yes and because the drive letter is assumed to match the drive letter of the workspace file, it is removed no matter what value is entered by the user.

Quote:
Then the trailing part of the file's path (after the LBD has been removed from the leading part) is appended to the end of the Remote Base Directory to obtain the remote path on the Server.

Exactly Smile

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
sudleyplace



Joined: 23 Jan 2008
Posts: 8

PostPosted: Wed Feb 13, 2008 11:45 pm    Post subject: Reply with quote

Quote:
Yes and because the drive letter is assumed to match the drive letter of the workspace file, it is removed no matter what value is entered by the user.

I strongly urge you not to delete anything the user enters. Signal an error if it's invalid, but if it's valid leave it alone. When you change something entered, a user quite rightly is going to ask "Why, what did I do wrong?". As the user has done nothing wrong, don't raise the issue. Just as you wouldn't delete the leading portions of the LBD which match the file's path, don't delete the drive letter!
Back to top
View user's profile Send private message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 2206

PostPosted: Thu Feb 14, 2008 1:05 am    Post subject: Reply with quote

Quote:
Just as you wouldn't delete the leading portions of the LBD which match the file's path, don't delete the drive letter!

I agree totally that this FTP configuration panel is confusing, but I am not sure of any other way it can be designed to work that is any less confusing Confused

The whole point of this panel is to define the mapping of a project file to a corresponding remote host file. Now the project file location is fixed and the remote file location is partially (defined since it must go to an ftp server address), but other than that the variations between the local an remote file locations are pretty much infinite.

For example consider just these few examples of possible mappings of local file to a corresponding remote file:
Quote:
d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/Division/Projects/MainPage/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/Div/Projects/MainPage/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/Projects/MainPage/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/MainPage/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/MyProjects/MainPage/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/MyProjects/index.html

d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/WebSite/index.html

So the FTP configuration panel has to provide a way to configure each and every one of these examples.

At present I think the current FTP panel does let you configure these types of mappings, granted in a some what confusing manner Wink

Now given this file d:\Division\Projects\MainPage\index.html, how should the dialog react to this nonsensical user input Question

Quote:
e:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/WebSite/index.html

It can only reject it with an error message, which has to contain enough information to explain to the user why the input is wrong, or it can try to fix it. I don't think either option works particularly well. The reason is that until the user understands what the dialog is trying to do, any amount of error messages or intervention is not going to help.

I think this is quite a difficult dialog to implement and while I don't think the current implementation is great, I don't think it is too far off. But I am always open to any other alternative designs Wink

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Zeus IDE Forum Index -> Reporting a Bug All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group