New topic: Uploading HTACCESS [Solved]
<http://forums.realsoftware.com/viewtopic.php?t=33792> Page 1 of 1 [ 11 posts ] Previous topic | Next topic Author Message rbasic20091005153 Post subject: Uploading HTACCESS [Solved]Posted: Fri May 14, 2010 9:08 pm Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 Hola, I use FTP (Shell) to download an htaccess file to a remote server. After revising it, I want to upload it back. When downloaded, a file extension of txt is added. If I try to manually upload the file that I've revised with my app, the htaccess file doesn't seem to be readable by a Linux server. Accessing the website, I run into a 500 error. In fact, I used to be careful enough to zip an htaccess file to upload so that it wouldn't get corrupted. Anyway, the following is the FTP syntax. Code:put /Users/JHicks/Library/Application\ Support/MyApps/htaccess.txt /public_html/.htaccess If I upload the same file with a 3rd-party FTP app, the htaccess file will be readable by the server. Furthermore, if I open the original backup file to copy the content and then paste it in the revised file, this file will be readable by the remote server. So what am I doing wrong? If I enforce the ASCII mode, the result will be the same. Is the Mac carriage return causing the problem? Muchas gracias for your advice, Clueless Tom _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Last edited by rbasic20091005153 on Sat May 15, 2010 3:33 am, edited 1 time in total. Top DaveS Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 9:28 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 2342 Location: San Diego, CA my input here... use cURL... it leaves the file as-is.... doesn't try to "guess" what the linefeeds should be etc.. I use it almost exclusively to move files around and have had no issues at all _________________ Dave Sisemore MacPro, OSX 10.6.2 RB2009r5.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top rbasic20091005153 Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 9:37 pm Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 GGGGG... You are obsessed. I've read several topics where people have expressed difficulty in using CURL. I didn't even know what CURL was until you mentioned it a few days ago in my previous question. It seems to me that CURL is a lot more complicated than FTP. Well, I guess I should take a closer look at it. Muchas gracias for your advice. _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Top DaveS Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 9:53 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 2342 Location: San Diego, CA actually cURL is much simpler.... most everything can be done with one command line.... and internally it encapsulates all the FTP handshaking etc.... Code:// to return a directory curl -s -S -u <username>:<password> FTP://www.myserver.com" // to download a file curl -s -S -u <username>:<password> FTP://www.myserver.com -o "+chr(34)+"<remotefilename>"+chr(34) // to upload a file curl -s -S -u <username>:<password> FTP://www.myserver.com -T "+chr(34)+"<localfilename>"+chr(34) // to Make a Directory curl -s -S -u <username>:<password> FTP://www.myserver.com -Q 'MKD <newname>' // to Remove a Directory curl -s -S -u <username>:<password> FTP://www.myserver.com -Q 'RMD <dirname>' // to Remove a File curl -s -S -u <username>:<password> FTP://www.myserver.com -Q 'DELE <filename>' // to Change File Permissons [UNIX ONLY] curl -s -S -u <username>:<password> FTP://www.myserver.com -Q 'SITE CHMOD <permission> <filename>'" // to Rename a File curl -s -S -u <username>:<password> FTP://www.myserver.com -Q 'RNFR <oldname>' -Q 'RNTO <newname>' _________________ Dave Sisemore MacPro, OSX 10.6.2 RB2009r5.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top rbasic20091005153 Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 10:01 pm Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 Whoa... Muchas gracias. It looks like I can do it. 'Man' doesn't display examples. I'll try uploading the file with CURL, then. _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Top DaveS Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 10:08 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 2342 Location: San Diego, CA of course those all need to be sent to SHELL and SH.results gives you back any returned data such a directory etc. it took a week or so of experimenting and Googling to get all that syntax correct. _________________ Dave Sisemore MacPro, OSX 10.6.2 RB2009r5.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top rbasic20091005153 Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 10:19 pm Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 Quote:it took a week or so of experimenting and Googling to get all that syntax correct. .. I'm close to being able to upload a file with CURL. I'm get an error message that says Quote:curl: (9) Server denied you to change to the given directory _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Top DaveS Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 10:27 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 2342 Location: San Diego, CA then your syntax is wrong.... or that directory does not exist _________________ Dave Sisemore MacPro, OSX 10.6.2 RB2009r5.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top rbasic20091005153 Post subject: Re: Uploading HTACCESSPosted: Fri May 14, 2010 10:38 pm Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 Okay. I'm able to upload a file with CURL. Whew... But the result is the same. WAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Top rbasic20091005153 Post subject: Re: Uploading HTACCESSPosted: Sat May 15, 2010 3:23 am Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 It's not about ASCII on/off, binary on/off, or encoding with UTF8. The only reason I can think of why the file becomes unreadable by a Linux server is the way I create the file to upload. Code:Dim Write2File As TextOutputStream Dim j As Integer Write2File=MyFile.CreateTextFile For j=0 To Listbox5.ListCount-1 Write2File.WriteLine ReplaceLineEndings(Trim(Listbox5.Cell(j,0)+Chr(13)),EndOfLine.UNIX) Next j Write2File.Close I've tried with many similar variations, any of which doesn't work. _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Top rbasic20091005153 Post subject: Re: Uploading HTACCESSPosted: Sat May 15, 2010 3:30 am Joined: Sat Apr 04, 2009 5:10 pm Posts: 865 It looks like the winner is the following. Code:Write2File.WriteLine Trim(Listbox5.Cell(j,0))+EndOfLine.UNIX _________________ Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4 -------------------------------------------------- Don't plugin-spam me. Watch out for European spammers who try to sell plug-ins you don't even need. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 11 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
