This topic is locked

Store image on server store the link in DB

4/3/2009 9:52:32 AM
PHPRunner General questions
U
Urnso author

Is it possible to not have the image upload but still save the link location in the DB? The images are already on the server, I will have users that will be moving images on a local network and then logging in updating information about the image and then linking its location.
Can this be done?

U
Urnso author 4/3/2009

The reason I won't use PHP tp upload is most of these images are over 100MB it will take entirely too long to move the file in PHP.

Sergey Kornilov admin 4/3/2009

Sure, you can enter path to image manually and set 'View as' type to 'Image'.

U
Urnso author 4/3/2009

Is it possible to hit a browse button and have the location be entered into the field? I would hate to manually enter locations for thousands of images. Is there a way to just stop it from uploading?

hfg 4/3/2009

I'm not positive I understand what your trying to do, but I think I so something similar.
All of my files are stored in the same place on the server (or at least like files are) so all I load into the DB is the name of the file.
In the case of one of my projects the files names are check numbers so I even use the sql to add the pdf at the end like this:
concat('http://XXX.XXX.XXX.XXX/files/ap/';, CheckNumber, '.pdf') AS Link,
CheckNumber is a field
I then make the Link field a hyper link and use CheckNumber as the "Display Field Content" field for the hyperlink.
This way all that has to be loaded into the DB is the Check Number and any info you want to go with it. I then manually copy the files to the proper location.
If you have files in different locations you could add a "Directory" field and add it to the concat
concat('http://XXX.XXX.XXX.XXX/';, Directory, '/', CheckNumber, '.pdf') AS Link,
This has worked very well for me, it is much faster.

U
Urnso author 4/3/2009

I can't seem to get this working. Am I adding this under custom view in visual editor?

hfg 4/6/2009

The concat goes in the SQL editor
You then define the type in visual editor (there is not custom code in the visual editor)