Author Topic: Download URL support for local network?  (Read 6508 times)

0 Members and 1 Guest are viewing this topic.

Offline Streetwise

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Download URL support for local network?
« on: March 25, 2003, 04:10:47 PM »
I am reposting a question here from the troubleshooting forum as this is apparently more of a mod than a troubleshooting issue:

I need to have the Download URL support a link to a local network such as: http://snapserver_1/images/AV3311.eps

Apparently there has to be a presence of both "www" and ".com" (or .something) in the URL for a sucessful upload of an image with a download path.

I'm looking for a way to be able to use a path that always starts out with "http://snapserver_1/" to be able to download from a network share.

V@no was kind enough to have me try a few things to the member.php file, but with no luck.

I've tried replacing:

Code:
 
Quote
$remote_media_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file'])));
  $remote_thumb_file = format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_thumb_file'])));


in member.php
with Code:
 
Quote
$remote_media_file = un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file']));
  $remote_thumb_file = un_htmlspecialchars(trim($HTTP_POST_VARS['remote_thumb_file']));

 

I've also tried replacing:

Code:
 
Quote
if ((empty($HTTP_POST_FILES['media_file']['tmp_name']) || $HTTP_POST_FILES['media_file']['tmp_name'] == "none") && ($remote_media_file == "" || !check_remote_media($remote_media_file))) {


replace with:
Code:
 
Quote
if ((empty($HTTP_POST_FILES['media_file']['tmp_name']) || $HTTP_POST_FILES['media_file']['tmp_name'] == "none") && ($remote_media_file == "")) {


Neither seems to work. I still get an error when I try to upload. (The page displays with red words in the Download URL area indicating that there's a problem.


Looking at the members.php file, it looks to me like it has to be something with modifying:

Quote
$image_download_url = (isset($HTTP_POST_VARS['image_download_url'])) ? format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['image_download_url']))) : "";


to remove the "www" and ".com" checking.

Any ideas in this MOD forum?

Thanks for your help!

Dave Anderson

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Download URL support for local network?
« Reply #1 on: March 25, 2003, 10:50:56 PM »
download_url?
I dont think it has anything to do, because by default there is no field, where users can add download url.
but, anyway try to change it to:
Code: [Select]
$image_download_url = (isset($HTTP_POST_VARS['image_download_url'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['image_download_url'])) : "";
I dont think this will help

but, here is another question:
did u add .eps extention to allowed, in the settings?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Streetwise

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Download URL support for local network?
« Reply #2 on: March 25, 2003, 11:22:53 PM »
Quote from: V@no
but, here is another question:
did u add .eps extention to allowed, in the settings?


 :oops:  Um. No. Where would I add that? Settings in the control panel?

So you're saying that the download URL has more to do with:

Quote
if ((empty($HTTP_POST_FILES['media_file']['tmp_name']) || $HTTP_POST_FILES['media_file']['tmp_name'] == "none") && ($remote_media_file == "")) {  


Any ideas as to how to remove the www and .com requirements? Or better yet, be able to hard code http://snapserver_1/ into it?

Thanks

Dave Anderson

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Download URL support for local network?
« Reply #3 on: March 25, 2003, 11:27:14 PM »
Quote from: Streetwise
:oops:  Um. No. Where would I add that? Settings in the control panel?

yes, in the settings, there is a text field, where u add extensios that u want allowed be uploaded.

when u add the extension, try do one or more changes u already tryed before ;)
also, try upload an image trough ACP
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Streetwise

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Download URL support for local network?
« Reply #4 on: March 26, 2003, 03:26:08 PM »
Quote from: V@no

when u add the extension, try do one or more changes u already tryed before ;)
also, try upload an image trough ACP


I added .eps to the list of allowable extensions. I then edited member.php to reflect each of the three suggested modification's, both individually, and all together. Still no luck...

http://snapserver_1/myimage.eps is apparently not a valid URL. But as soon as I add a 'www' and '.com', then it works fine...

  :?   It *has* to be as simple as figuring out how to strip out the URL formating stuff for the "Download URL" field...

As always, V@no, thanks for the suggestions. Keep 'em coming!

Dave

Offline Streetwise

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Download URL support for local network?
« Reply #5 on: March 26, 2003, 05:50:19 PM »
Quote from: Streetwise

     It *has* to be as simple as figuring out how to strip out the URL formating stuff for the "Download URL" field...



Ahem. Official way to link "Download URL" to a network server location:

Drumroll......

just use a relative path! That's right... a relative path.

What I discovered is that since (in my case), "snapserver_1" is on our network as part of the domain, I do not need to have the URL be "http://snapserver_1/myimage.eps" even though that's a valid URL from within the network.

All I need to do is to use "//snapserver_1/myimage.eps" which 4Images doesn't seem to balk at. No muss, No fuss... No edit to members.php needed...

 :mrgreen:

Thanks V@no/Jan for your help and suggestions!

Dave Anderson

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Download URL support for local network?
« Reply #6 on: March 26, 2003, 06:00:47 PM »
Quote from: Streetwise

just use a relative path! That's right... a relative path.

Doh!
lol :lol:
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Streetwise

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Download URL support for local network?
« Reply #7 on: March 26, 2003, 06:08:39 PM »
Quote from: V@no
Quote from: Streetwise

just use a relative path! That's right... a relative path.

Doh!
lol :lol:



hehehe!  :D

--Dave