Help - Search - Members - Calendar
Full Version: Help With Zymic Server And Java Code
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
jjw123
so basically i have uploaded a txt file to the ftp server and i can access it ok, but i am trying to access it through java code and it seems to be accessing the html code for the "The address you have entered is not open to the public." error message.

any ideas what could be happening?
ssfdre38
change the txt file to index.html
jjw123
still the same issue, maybe the website is not properly activated?
ssfdre38
show me with a screenshot
jjw123
im not sure how, basically i have a txt file loaded onto the server, im then trying to access it through java code to check if whats written in there is the same as a variable in my code.

but whenever i load it up it just seems to be recieving this code instead of whats in the txt file


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>403 Forbidden!</title> <link rel="stylesheet" type="text/css" href="/404/style.css" /></head><body><div id="container"><div id="logo"><a href="http://www.zymic.com/"><img src="/403/images/logo.png" alt=""/></a></div><div id="main"><h2><img src="/403/images/error.png" alt="" /> 403 Forbidden!</h2><p>The address you have entered is not open to the public. Here are some sponsored websites you may be interested in:</p><div id="hostingads"><script LANGUAGE="JavaScript" SRC="http://www.hostingcatalog.com/banner.php?id=8A94E920AB94F0A0DC79FD16347AD06D848187B216F2988725646B1ED6B3F2CC23CC7CBFE1D17
EA1"></SCRIPT></div></div><p align="center"><a href="http://www.zymic.com/free-web-hosting/"><img src="/404/images/learn-more404.png" alt="Get your free website" width="451" height="61" /></a></p </div></body></html>

but yet when i navigate to the webpage on my browser, it shows the webpage
ssfdre38
i want a screenshot of the FTP Client with it logged int your hosting account
Vhati
You can see the file in a webbrowser, but when you have java retrieve the same url you get redirected?

Run Wireshark. Sniff both scenarios, and compare the requests by right-clicking a server response packet and choosing "Follow TCP Stream".
I think Zymic is reacting to Java's default user agent.

This fixed the problem for me:
CODE
httpConnection.setRequestProperty("User-Agent", "INSERT YOUR BROWSER'S AGENT STRING HERE");
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.