Problem with file server

I have implemented a very simple web server on my Arduino Mega which purely makes SD card files visible to the internet – part of an existing sketch. The ‘home’ page is largely descriptive but does contain an edit field (for the filename) and a Submit button.
As the IP address is not static, I have registered a hostname with Noip. I have also forwarded the port on my router to the Arduino IP address. I have also verified that the port is open.
The web page works fine when I access “hostname” from the network side of the router and can view SD card files However, when I test on the internet side of the router, the problem occurs. I initially get the home page (as expected), but having filled in the edit box with the filename and clicked on the Submit button, there is no response. (From the serial monitor, it is also clear that the home page request is received, but not the filename request)
I have examined the router (Plusnet Hub One) event log and there are no abnormal entries.
How can I progress this problem ? Appreciate any advice !!

Check the form method and action values.

hi Tim,
Spot on !!!
In my ignorance, I had specified the network-side URL (i.e. 192.168. etc) Substituting the Noip hostname and everything works !!!
Many thanks for your superb diagnosis (as usual !)

You shouldn't need to put the hostname or the IP in the action field. It will use whichever you loaded the page with.

SurferTim:
You shouldn’t need to put the hostname or the IP in the action field. It will use whichever you loaded the page with.

Hi Tim,
I’m a complete novice with all this HTML stuff.
I currently have:-
pClient->println(F("<FORM ACTION="[hostname]" method=get >"));

Is the syntax
pClient->println(F(""));

Appreciate your help !

The action parameter should contain only the page. If you want the default home page:

<form action="/">

OK ! Thanks again Tim !