Incorrect FTP URL When Uploading File

If reporting a bug with the Zeus editor please post the details here. Please do not post questions here.
sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Incorrect FTP URL When Uploading File

Postby sudleyplace » Mon Feb 11, 2008 11:34 pm

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?

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Tue Feb 12, 2008 1:06 am

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 :(

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:
D:\nars2000\trunk\htdocs\index.ahtml

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

and it looks like this:
<!-- 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:
<!-- 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:
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:
ftp://ftp.nars2000.org/htdocs/index.ahtml

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

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

which is exactly what I want :)

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 ;) 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:
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 ;)

Cheers Jussi

sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Postby sudleyplace » Tue Feb 12, 2008 8:24 pm

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?

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Tue Feb 12, 2008 10:28 pm

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 repeat the steps shown above with your system what data do you enter at each step and what exactly gets displayed and goes wrong :?:

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 :?: Is this some sort of FTP configuration thing :?:

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 :?

Cheers Jussi

sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Postby sudleyplace » Tue Feb 12, 2008 11:35 pm

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."

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Wed Feb 13, 2008 12:08 am

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 :?:

For example here is the screen capture of my FTP configuration panel:
Image
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 ;)

Cheers Jussi

sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Postby sudleyplace » Wed Feb 13, 2008 1:47 am

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!

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Wed Feb 13, 2008 2:46 am

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 :?

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

Cheers Jussi

sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Postby sudleyplace » Wed Feb 13, 2008 3:14 am

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.

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Wed Feb 13, 2008 3:35 am

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 :)

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 ;)

Cheers Jussi

sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Postby sudleyplace » Wed Feb 13, 2008 5:03 pm

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.

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Wed Feb 13, 2008 10:43 pm

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:
This example local file:

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

will map to the following remote file:

ftp://ftp.nars2000.org/nars2000?trunk/h ... ndex.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:

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.

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 :)

Cheers Jussi

sudleyplace
Posts: 8
Joined: Wed Jan 23, 2008 9:19 pm

Postby sudleyplace » Wed Feb 13, 2008 11:45 pm

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!

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Thu Feb 14, 2008 1:05 am

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 :?

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:
d:\Division\Projects\MainPage\index.html <=> ftp://ftp.server.com/Division/Projects/ ... 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 ;)

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

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 ;)

Cheers Jussi


Return to “Reporting a Bug”

Who is online

Users browsing this forum: No registered users and 0 guests

cron