Bruce
02-10-2009, 04:03 PM
Hello everyone…
Looking to make an FTP up loader for my photographers to upload video to my site. www.newsmediaservices.com
I’ll have four buttons, Picture.jpg, Movie.flv, Movie.zip and Upload files.. The script in the Picture.jpg button reads like this:
jpg_result = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", ".jpg", false, false);
Paragraph.SetText("jpg Paragraph", jpg_result[1]);
The return I get looks like this:
C:\Documents and Settings\Administrator\Desktop\G68morisita0009.jpg
What I need to show is simply G68morisita0009.jpg I know this has something to do with string trimming.
The upload button holds the following script:
Paragraph.SetText("info Paragraph", "Connecting to server...");
Connected = HTTP.TestConnection("www.google.com", 8, 80, nil, nil);
if Connected then
Paragraph.SetText("info Paragraph", "Connecting to server...");
FTP.Connect("www.mysite.com", "login", "password", "", true);
--Check to see if it's ok to gain access
FTP.ChangeDir("websites/newsmediaservices.com/docs/ok");
yes_result = FTP.GetFileInfo("peter_davidson.txt");
if yes_result == nil then
result = Dialog.Message("Notice", "You're no longer allowed to use this service. If you think this is an error, go to www.newsmediaservices.com for contact information.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Application.Exit(0);
end
FTP.Download("peter_davidson.txt", _TempFolder .. "\\peter_davidson.txt", nil);
--reads it into memory
yesno_result = TextFile.ReadToString(_TempFolder .. "\\peter_davidson.txt");
--then turns that into a #
aresult = String.ToNumber(yesno_result);
--deletes the text file
File.Delete(_TempFolder .. "\\peter_davidson.txt", false, false, false, nil);
if aresult == 1 then
--yes it passed
--first the .jpg
Paragraph.SetText("info Paragraph", "Changing directory...");
FTP.ChangeDir("websites/newsmediaservices.com/docs/ftp");
Paragraph.SetText("info Paragraph", "Uploading .jpg...");
FTP.Upload(jpg_result, jpg_result, nil);
HAVING AN ISSUE HERE IN RED
See any other messups let me know, thx
Looking to make an FTP up loader for my photographers to upload video to my site. www.newsmediaservices.com
I’ll have four buttons, Picture.jpg, Movie.flv, Movie.zip and Upload files.. The script in the Picture.jpg button reads like this:
jpg_result = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", ".jpg", false, false);
Paragraph.SetText("jpg Paragraph", jpg_result[1]);
The return I get looks like this:
C:\Documents and Settings\Administrator\Desktop\G68morisita0009.jpg
What I need to show is simply G68morisita0009.jpg I know this has something to do with string trimming.
The upload button holds the following script:
Paragraph.SetText("info Paragraph", "Connecting to server...");
Connected = HTTP.TestConnection("www.google.com", 8, 80, nil, nil);
if Connected then
Paragraph.SetText("info Paragraph", "Connecting to server...");
FTP.Connect("www.mysite.com", "login", "password", "", true);
--Check to see if it's ok to gain access
FTP.ChangeDir("websites/newsmediaservices.com/docs/ok");
yes_result = FTP.GetFileInfo("peter_davidson.txt");
if yes_result == nil then
result = Dialog.Message("Notice", "You're no longer allowed to use this service. If you think this is an error, go to www.newsmediaservices.com for contact information.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Application.Exit(0);
end
FTP.Download("peter_davidson.txt", _TempFolder .. "\\peter_davidson.txt", nil);
--reads it into memory
yesno_result = TextFile.ReadToString(_TempFolder .. "\\peter_davidson.txt");
--then turns that into a #
aresult = String.ToNumber(yesno_result);
--deletes the text file
File.Delete(_TempFolder .. "\\peter_davidson.txt", false, false, false, nil);
if aresult == 1 then
--yes it passed
--first the .jpg
Paragraph.SetText("info Paragraph", "Changing directory...");
FTP.ChangeDir("websites/newsmediaservices.com/docs/ftp");
Paragraph.SetText("info Paragraph", "Uploading .jpg...");
FTP.Upload(jpg_result, jpg_result, nil);
HAVING AN ISSUE HERE IN RED
See any other messups let me know, thx